Please login or register.

Login with username, password and session length
Pages: [1] 2 3

Author Topic: Problem with Batch files executing?  (Read 63675 times)

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Problem with Batch files executing?
« on: April 07, 2008, 04:58:07 PM »

On occasion I've noticed some of my batch files didn't fire! :(
Possibly a bug in AHP 3.2.0.6?  ???  ::)
Even trying to manually trigger the batch file from inside AHP fails! :( ???

A fix:
Edit the Macro, redo the path for the Batch file and save the macro
Of coarse I found this was only temporary! ::) :(

A better Solution:
Convert Batch files to EXE files
The freeware program I used : Bat-To Exe_Converter from F2KO
So far no issues with exe files not firing  ::) ;) (time will tell if this is truly the permanent solution!)

No guarantee that this will work for everyone or for all batch files but hopefully this will be found helpful for a few users! ;) ;D >:(
The Best solution:
X10 gets a new version out with all the bugs users have reported fixed!  ;) :D ;D
Don't hold your breath for this one to happen any time soon folks! :( ::)

Update: Read on for a workaround that works! ;)
« Last Edit: April 13, 2008, 09:30:19 AM by Tuicemen »
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Re: Problem with Batch files executing?
« Reply #1 on: April 07, 2008, 05:41:10 PM »

On occasion I've noticed some of my batch files didn't fire! :(
Possibly a bug in AHP 3.2.0.6?  ???  ::)
Even trying to manually trigger the batch file from inside AHP fails! :( ???

A fix:
Edit the Macro, redo the path for the Batch file and save the macro
Of coarse I found this was only temporary! ::) :(

A better Solution:
Convert Batch files to EXE files
The freeware program I used : Bat-To Exe_Converter from F2KO
So far no issues with exe files not firing  ::) ;) (time will tell if this is truly the permanent solution!)

No guarantee that this will work for everyone or for all batch files but hopefully this will be found helpful for a few users! ;) ;D >:(
The Best solution:
X10 gets a new version out with all the bugs users have reported fixed!  ;) :D ;D
Don't hold your breath for this one to happen any time soon folks! :( ::)

Seen this too. Even occurs for me with "EXE" files unfortunately.  >:( :(

I find that anytime I close AHP and restart it, that I have to re-do the path in the macro. Weird thing is, I only have to do it for one macro and then all macros execute their files again.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Problem with Batch files executing?
« Reply #2 on: April 07, 2008, 05:54:53 PM »


Seen this too. Even occurs for me with "EXE" files unfortunately.  >:( :(

I find that anytime I close AHP and restart it, that I have to re-do the path in the macro.
Hum I hadn't noticed this with my exe files  ::) But just did >:( >:( ::)! So much for that Work around!
Quote
Weird thing is, I only have to do it for one macro and then all macros execute their files again.
Ya noticed that too! ::) ???
I don't recall the issue with version 3.204 ::)
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Problem with Batch files executing?
« Reply #3 on: April 13, 2008, 09:00:09 AM »

Out of curiosity I thought I'd try the EU version to see if the bug was present there as well!
Guess it isn't only the programmers on this side of the pond that missed that bug!
I also noticed only my EXE files I created stop working, simple ones that just open a program still worked! ::) :( ::) :(

I had originally thought this was the result of windows updates as AHP was running 24/7 and PC usually rebooted after an update which was when I first noticed this! :(
Thinking it was only batch file execution that was failing resulted in my original post which no doubt gained me some Unhelpful ratings ::) :( (another topic)!
To prove I'm not one to give up easily and that there is usually a workaround for any obstacle I pressed forward!
I now have a work around for this and am currently testing with great success so far 25 restarts and counting, with no  Batchfile or EXE file miss fires (no failed execution)!
I'll post a step by step how too once my tests are finished!
For those that can wait for my tests to complete you can also get this working using a program I wrote about  in Expand your macros functionality called AutoHotKey.
For those that don't have it yet, Get it!
 Your going to need it!
;)
« Last Edit: April 13, 2008, 10:17:38 AM by Tuicemen »
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Re: Problem with Batch files executing?
« Reply #4 on: April 13, 2008, 02:44:51 PM »

Thinking it was only batch file execution that was failing resulted in my original post which no doubt gained me some Unhelpful ratings ::) :(

If this is the case, then shame on those who did.

Bringing attention to this problem and trying to come up with a work around should be applauded, not insulted.

Keep up the good work on this problem.  :)
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Problem with Batch files executing?
« Reply #5 on: April 13, 2008, 06:18:46 PM »

Thanks for the encouragement Puck!
I've finished testing the AutoHotKey workaround!
Here are my findings:

With a general AutoHotKey created exe icon press, AHP fires 100% of the time and reconfigured a troubled windows command macro successfully!
When adding the AutoHotKey created exe to the start up folder and rebooting the PC,AHP fires 100% of the time and reconfigured a troubled windows command macro 85% of the time successfully!
I'm thinking it is a time issues as some reboots connect to the internet faster then others.This time variance can be compensated by changing the pause value in the script from 100 to possibly 150 although in my tests setting to this value made it look like the script didn't complete when infact it had!
As promised here is a step by step to create a AutoHotKey AHP start exe that auto fixes the problem with the windows command options:

  • Install AutoHot Key and open it's root folder
  • Open the folder"AutoScriptWriter" and click on (open) AutoScriptWriter.exe
  • Browse to the ActiveHm.exe (usually in C:\Program Files\ActiveHome Pro) the path and file should appear in the "Initiate the following run line upon record" box
  • Ensure record & Shrink and record mouse buttons are depressed
  • Press record,AHP will now open and a stop botton will appear in the top left of the screen
  • Click on the room that a troubled macro is in 
  • Next click on edit for the troubled macro
  • Re-point to the batch file or exe
  • Next click on the floppy icon in the bottom Right to save (Note: AHP hotkeys will work here too and usualy work better)
  • Next click on the stop record button
  • The AutoScriptWriter screen will appear with all mouse movements and button presses recorded
  • Go to the bottom of the script and add the line "Exit," (minus the quotation marks)
  • Click save and give it a name you'll remember
  • Close the AutoScriptWriter

OK you've created the script 
Now to convert it to an exe file:
  • Open the AutoHotKey root folder
  • Open the Compiler folder
  • Open Ahk2Exe.exe file
  • For the source file you browse to the script you just created and click save
  • For the destination file browse to the location you'd like the file created and type in the name you wish to give it and click save
  • For the custom icon you like to use browse and find one and click save(if you don't add anything here it uses the default)
  • Type N/A in the passphrase and verify passphrase
  • Click convert then close Ahk2Exe

You've now a new AHP starting script which auto fixes all problem window command macros.
Use this to start AHP now instead of the way you use to start AHP replacing any AHP shortcuts with short cuts to this new file ;)
You can even use it in your start up!
Note: For the Custom icon I used Icon Sucker and pulled the icon from AHP so this new file even looks like AHPs short cut!
I only hope this works as well for every one else as it does for me! ;)

Edited to fix code issues from older forum software update
« Last Edit: January 01, 2010, 12:51:45 PM by Tuicemen »
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Problem with Batch files executing?
« Reply #6 on: April 18, 2008, 03:42:26 PM »

Update:
I rebuilt my initial AutoHotKey start file using AHP hotkeys where ever possible instead of mouse movements, Just after I posted the how too!
To date AHP has started very time and successfully redone the windows command macro causing issues!
I have since not, missed one sound file played from a batch file or exe file! ;)
This is even with reboots sometimes 2- 3 times a day for program, and virus updates!
So far It is working better then initially reported! ;)
I do how ever see one area where I may need to make some improvements as AHP remembers last folder opened!
If I load another AHX file and forget to set AHP so it sees my batch file folder my AutoHotkey start up will fail to relocate the file for my windows command macro! :( ::)
« Last Edit: January 27, 2009, 07:49:35 PM by Tuicemen »
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Problem with Batch files executing?
« Reply #7 on: January 02, 2009, 04:28:17 PM »

Update:
After downloading 3.236 I had to test to see if this batch file ,EXE file executing problem was solved! ::) :'
I shouldn't have wasted my time! ::) :'  >*< The issue still exists thankfully my work around has worked flawless even with the newest update!
Probably over 1,000 restarts with no batchfile/exe issues! :)%
 >!
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Problem with Batch files executing?
« Reply #8 on: January 15, 2009, 05:59:07 PM »

I've been working with Windows 7 for a couple of days now and thought it was about time I started adding AHP and some of the thirdparty software programs!
I wasn't looking forward to recreating my script file so I copied into my New test PC and the AHP folder!I was amazed that it worked first go !  :)%
So save that script file it will save you some time when/if you update your OS!
 >!
« Last Edit: November 16, 2010, 08:56:33 AM by Tuicemen »
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

gardavis

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 3
Re: Problem with Batch files executing?
« Reply #9 on: March 02, 2009, 04:09:48 PM »

I am working on a Garage Door solution and my macro calls a batch script to execute an X10WavPlayer. Sometimes, I see this error on the server that is running AHP. I normally connect to the server via Remote Desktop which may or may not have audio redirected.

Anyhow, the error I see is "Unable to parse command line arguments". The stack trace shows System.Runtime.InteropServices.COMException at SpeechLib.SpVoiceClass.Speak() at X10WavPlayer.Form1.play() at ...initializecommandline().

So this may be different than what this thread is about since it looks like the batch file is started up and it is starting up the X10WavPlayer.

This is the batch file contents:

@start "" /B "C:\Program Files\X10WavPlayer\X10WavPlayer" "Please be advised that the garage door is opening. Repeat, the garage door is opening. Thank you." 0

Thanks,
Gary Davis


Logged

gardavis

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 3
Re: Problem with Batch files executing?
« Reply #10 on: March 02, 2009, 04:12:34 PM »

Oh yeah. I am running this on Windows Server 2008.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Problem with Batch files executing?
« Reply #11 on: March 04, 2009, 04:13:29 PM »

gardavis
The problem I is indeed the Batch file!
the quotations marks are confusing X10WavPlayer!
try:
Code: [Select]
@echo off
cd C:\Program Files\X10WavPlayer
X10WavPlayer "Please be advised that the garage door is opening. Repeat, the garage door is opening. Thank you." 0
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Problem with Batch files executing?
« Reply #12 on: November 16, 2010, 10:53:53 AM »

Update:
As of now AHP is in version 3.296, I've just installed Windows 7 64bit and problem still exists.
Hoping my original Autothotkey script would work I just copied it from my old 32 bit OS.Since 64 bit puts AHP in a different route directory (Program Files (x86)) I had to rebuild from scratch or reinstall AHP to Program files  folder.
I decided to rebuild the Autohotkey file the good new it still works even with 64bit! :)% 
 >!
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: Problem with Batch files executing?
« Reply #13 on: November 16, 2010, 11:21:16 AM »

I haven't played with macros running batch files, but what path are you running the batch files from, and what path does it keep resetting to?
Perhaps there is a permission issue with the file used to store the setting (I found a problem a few years ago with the "smart macros Wizard" preference (it kept reverting back from "advanced" to "wizard"), and it turned out it was a registry key.
You might be able to force the file location by fixing the underlying problem, or by scripting that change before opening AHP.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Problem with Batch files executing?
« Reply #14 on: November 16, 2010, 01:07:38 PM »

Noam:
It doesn't matter what path you use I've even added the batch files and exe files to the AHP folder.
The info (paths) in the macros never change (revert).
The macro fires but the windows command part  appears to start but fails.
They always will work when you first set up the macro but always fail once you restart AHP

The work around here has never failed me once since I started using it.
Note: you only need to rebuild one windows command macro or create a new one and all other macros with windows commands start to work correctly.
You might be able to force the file location by fixing the underlying problem, or by scripting that change before opening AHP.
The file location isn't the issue AHP will open any file in any location the first time you set up the macro.
Scripting a macro edit works fine and actually speeds up the load of AHP as you can close any pop up screens that appear on loading with the script as well.
I actualy have several windows command macros which open files in many locations and they all work!
 >!
Logged
Please Read Topic:
General Forum Etiquette
Before you post!
Pages: [1] 2 3
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.