Please login or register.

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

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

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: Problem with Batch files executing?
« Reply #15 on: December 01, 2010, 04:54:49 PM »

Well it had to happen my batch files stopped working.
I noticed win 7 wasn't opening the correct folder  when I clicked on the edit button in AHP.
Some place I'd never opened before even in explorer. Maybe a 3.296 bug ??? ::) :'
in any case I desided to redo my autostart again this time typing in the path to the edited batch file. So here is the revised step by step.
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 windows command macro is in 
Next click on edit for the macro
In the box that pops up type the complete path of the exe file or batch file for that macro
click ok
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 AutoScriptW
you can now convert it to a exe file if you wish and use that to open AHP
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: Problem with Batch files executing?
« Reply #16 on: December 22, 2010, 05:18:15 PM »

Finally thanks to the newest batch of programmers at X10 this is Fixed!
EXE files fire every time as do Batch files.
However you need to specify the full path to the program in the batch file even if it is in the same folder as the program your trying to start.
So if you use Batch files included in PcCompanion you need to edit the files and replace the CD.. with the full path to PcCompanion
Here is an example of my the "Time(0)".bat file before and after the edits
Before:
Code: [Select]
@ echo off
CD..
PcCompanion ">Time?<" 0
After the edit:
Code: [Select]
@ echo off
Cd C:\Program Files (x86)\PcCompanion
PcCompanion ">Time?<" 0
Hope this helps anyone that is still having issues!
 >!
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 #17 on: December 22, 2010, 07:25:27 PM »

To make sure I understand this:
The batch file you were using (and the batch file complied to EXE, also) had a relative path in it, that was based on the location of the batch file.
Since AHP was executing the batch file from a different "working directory," the batch file itself would run, but since the first command was to change to a relative path that didn't exist in relation to the working directory, the rest of it didn't work?

So it wasn't really an AHP problem then, right? moving the batch file a different folder and running it from there (from a command prompt) would have also failed, right?

Does putting in an absolute path work EVERY TIME?
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: Problem with Batch files executing?
« Reply #18 on: December 22, 2010, 08:45:57 PM »

To make sure I understand this:
The batch file you were using (and the batch file complied to EXE, also) had a relative path in it, that was based on the location of the batch file.
Yes.
Quote
Since AHP was executing the batch file from a different "working directory," the batch file itself would run, but since the first command was to change to a relative path that didn't exist in relation to the working directory, the rest of it didn't work?
But in AHP you specify where the batch file or program(exe) is, you could have it in the root folder or anywhere.
In the example I posted above the files were in a sub directory of the exe file. But I had also tried it with PCCompanion in AHPs root folder and using the full path.
AHP allways executed the file from the directory(folder) that the file was in place.

Quote
So it wasn't really an AHP problem then, right?
Yes it was a AHP issue.This issue  even applied to opening a program like internet explorer not using a batch file.
Even with a full path in the Batch file it failed
Quote
moving the batch file a different folder and running it from there (from a command prompt) would have also failed, right?
using the example of the batch file I posted Yes it would have fail placing it anywere else.
Quote
Does putting in an absolute path work EVERY TIME?
yep, it does now! ;)
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 #19 on: December 23, 2010, 08:28:05 AM »

Ok, now I'm even MORE confused.
When did they fix the issue in AHP?
I didn't see anything about that, and somebody (was it you?) said that even with 3.301, the bug wasn't fixed.
They haven't released anything since 3.301 (that I know of).

Also, I think you had mentioned that if you go into AHP and edit the macro, that fixes it (until you close AHP and re-open it). THAT sounds like a bug to me. It should execute it the same way every time, no matter what.
Perhaps they should add in a "working directory" option for the program, so things that require relative paths can still work.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: Problem with Batch files executing?
« Reply #20 on: December 23, 2010, 08:41:38 AM »

Yes. it was me that stated the windows command option was still broken with this version. I did jump the gun on that! However once I re did my macros pointing to exe files they worked.
And when Eric stated He couldn't reproduce my issues with Batch files I started to play a little more.
I'm Not saying it is working the way I'd like it to but it now works at least, and no extra work is required for it to fire (Open)Programs exe.
Command line paramiter batch files or EXEs made from these need a little work.
 >!
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

hpdrifter

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 68
Re: Problem with Batch files executing?
« Reply #21 on: December 28, 2010, 10:34:10 PM »

Finally thanks to the newest batch of programmers at X10 this is Fixed!
EXE files fire every time as do Batch files.
However you need to specify the full path to the program in the batch file even if it is in the same folder as the program your trying to start.
So if you use Batch files included in PcCompanion you need to edit the files and replace the CD.. with the full path to PcCompanion
Here is an example of my the "Time(0)".bat file before and after the edits
Before:
Code: [Select]
@ echo off
CD..
PcCompanion ">Time?<" 0

After the edit:
Code: [Select]
@ echo off
Cd C:\Program Files (x86)\PcCompanion
PcCompanion ">Time?<" 0
Hope this helps anyone that is still having issues!
 >!
What did the programmers do?  Just recently?  I have 3.236.  Will it take an upgrade?  My window's command line usage is hit or miss.

Edited by Tuicemen to fix quote(readability)
« Last Edit: December 28, 2010, 10:52:44 PM by Tuicemen »
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: Problem with Batch files executing?
« Reply #22 on: December 28, 2010, 11:04:45 PM »

What the programmers did and if it was done with this latest release or prior only they know! ::) :'
Your version of AHP is Upgradeable you can find the files here: http://www.x10.com/support/support_soft1.htm
Since fixing the line in my batch file and updating to 3.301 my batch files have fired 100% .
The work around had worked for me until I switched to windows 7 64 bit. Then I had to rebuild the script file and by the time I had it tweaked X10 had this release out.
 >!
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

hpdrifter

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 68
Re: Problem with Batch files executing?
« Reply #23 on: December 28, 2010, 11:39:28 PM »

I tried the "fix" you posted.  I guess it's over my head.  I never saw the "record" in the lower left corner.

I did click on a record right beside the "initiate run line upon record" box. and the "stop".

I recorded...."somethng" and used an AHP icon for that exe file to start AHP.

All I got in the script box was a bunch of Window(activate) and mouse moves.

When finished the macros seemed to work, but because of what????????????????
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: Problem with Batch files executing?
« Reply #24 on: December 29, 2010, 07:34:31 AM »

It couldn't have been too over your head you got it to work! ;)

Basicaly you made AHP think you made a new windows command macro.
Doing this for some reason made all the other windows command macros work as well.

If you open AHP (prior v 3.301) without your script file windows command macros failed 100%
Recreate one or create a new one and they would all start working until you restarted AHP again. ::) :'
The reason? ???
Without being able to dig into the old code I have no idea!
 >!
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 #25 on: December 29, 2010, 09:11:42 AM »

Has anyone tried testing an older version of AHP (like 3.236), but using batch files that have an absolute (instead of a relative) path in them?
That would be the test to know for sure if they made any changes to that part of AHP in any of the 2010 updates.

I didn't think they had made changes to the code, since you reported the problem still existed it AFTER they released 3.301, and Erik didn't seem to know about the issue. I would think he would have mentioned something had they worked on that part of the code.

As to why your "workaround" of creating a new macro worked, I'm baffled. THAT sounds like a bug to me.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: Problem with Batch files executing?
« Reply #26 on: December 29, 2010, 10:30:23 AM »

Actualy I had mentioned to Eric about this issue a week before the SDK crash issue and He said he would look into it for the next release which was this one.
That may be why he sounded confused when I stated it was still an issue.
hpdrifter stated he was using 3.236 and had the issue.
 >!
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 #27 on: December 29, 2010, 11:20:19 AM »

Sorry, I wasn't aware of that.
I think the 3.301 release was more of an "emergency" release, since the new SDK didn't like something in the prior releases. I don't think it was a planned update. I'll bet the developers are probably taking some vacation for the holidays, but I wouldn't be surprised if we hear something about this in January.
Logged

hpdrifter

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 68
Re: Problem with Batch files executing?
« Reply #28 on: January 04, 2011, 12:02:06 AM »

Well, I've noticed a few things after working "the fix".

1  my batch files work.
2 upon start up the "video device not installed" box doesn't come up.
3 "Show conditions" doesn't work.  It never gives me the option to show conditions.

I went back and opened AHP with the regular exe and "Show conditions" in macros worked.???????????
Logged

hpdrifter

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 68
Re: Problem with Batch files executing?
« Reply #29 on: January 04, 2011, 08:57:58 PM »

Plus one more item:

On the task bar, where AHP resides, I get a "Featured Option loaded" notification.

Guess I'll have to use AHP shortcut and not Hotkeys.
Logged
Pages: 1 [2] 3
 

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