Sign in to follow this  
Followers 0
CygnusX1

Running a .BAT file

5 posts in this topic

Hello All,

I have a script that I'm trying to call a .BAT file from

Run("file_compare.bat", "c:\program files\program name\root dir")

The help says to use a file name then the working directory, which is what I'm doing.

I have downloaded the latest release of AutoIt

For what it's worth, the .BAT runs ImageMagick and compares a directory full of images. I can get the .BAT file to run from the CMD window or double clicking on the file in the directory.

Any ideas why this wouldn't be working?

Thanks

Cygnus


Cygnus

Share this post


Link to post
Share on other sites



I think you might need ShellExecute() with a .bat file.

Share this post


Link to post
Share on other sites

Thank you, ShellExecute worked!

ShellExecute("file_compare", "", "C:\Program Files\program name\root dir")

Cygnus


Cygnus

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

You may need to path out the executable:

$sDir = "c:\program files\program name\root dir"
$sFile = "file_compare.bat"
Run($sDir & "\" & $sFile, $sDir, @SW_SHOW)

:)

Edit: Well that's what I get for not checking on replies already posted:

Thank you, ShellExecute worked!

ShellExecute("file_compare", "", "C:\Program Files\program name\root dir")

Cygnus

:P Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Edit: Well that's what I get for not checking on replies already posted:

Happens to me all the time. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0