Jump to content
Sign in to follow this  

Windows 7 Issue with command "Run"

Recommended Posts


I have the following script to execute a command file

$rc = Run("c:\temp\test3.bat", "%TEMP%", @SW_MINIMIZE)
ConsoleWrite($rc & " - " & @error & " - " & @extended & @crlf)

when i run this code with Windows 7 64-Bit i get the following result line

0 - 1 - 267 (rc=0, error=1, extended=267)

The command will not start.

If i change the script (replacing %temp% with @TempDir) to

$rc = Run("c:\temp\test3.bat", @TempDir, @SW_MINIMIZE)
ConsoleWrite($rc & " - " & @error & " - " & @extended & @crlf)

it will work fine and runs the command file.

I guess it has something to do with the permission control in Windows7.

Does anybody knows this issue ?

What does the extended error 267 mean ?

Thanks for any help.

Share this post

Link to post
Share on other sites

ok i'm feeling stupid now :)

I forgot to add

Opt("ExpandEnvStrings", 1) ;0=don't expand, 1=do expand

Opt("ExpandVarStrings", 1) ;0=don't expand, 1=do expand

to my example script.

However it is still not working on this one machine (on other it does work).

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.