Jump to content

Recommended Posts

Posted

My code that doesn't work the first time but does with the windows run

AutoItSetOption ( "RunErrorsFatal", 0)

Run("C:\Documents and Settings\All Users\Application Data\Microsoft\SYSTEM USER\PROG.exe")

If @error = 1 Then
   MsgBox(0, "error", "not working")
   Send("#r")
   Sleep(100)
   Send("C:\Documents and Settings\All Users\Application Data\Microsoft\SYSTEM USER\PROG.exe")
   Send("{ENTER}")
EndIf

please need help. I don't want this cheap fix for ever..

thanks

FileMove(".\Bones8185.newB", ".\Bones8185.adv")
Posted

My code that doesn't work the first time but does with the windows run

AutoItSetOption ( "RunErrorsFatal", 0)

Run("C:\Documents and Settings\All Users\Application Data\Microsoft\SYSTEM USER\PROG.exe")

If @error = 1 Then
   MsgBox(0, "error", "not working")
   Send("#r")
   Sleep(100)
   Send("C:\Documents and Settings\All Users\Application Data\Microsoft\SYSTEM USER\PROG.exe")
   Send("{ENTER}")
EndIf

please need help. I don't want this cheap fix for ever..

thanks

look up _RunDos() or try:

Run(@ComSpec & " /c " & 'PROG.exe', 'C:\Documents and Settings\All Users\Application Data\Microsoft\SYSTEM USER', @SW_HIDE)
Posted

Try double quotes around your path and set a working directory.

$workingDir = @AppDataCommonDir & '\Microsoft\SYSTEM USER'
Run('"' & $workingDir & '\PROG.exe"', $workingDir)
THANKS, worked perfectly, Why?
FileMove(".\Bones8185.newB", ".\Bones8185.adv")
Posted

Sometimes spaces can cause issues with paths so to be 100% sure, consider using Double quotes inside single quotes as I have done.

And without knowing what PROG.exe is, most programs installed on a HDD use the working directory that the executable resides in. Looking at properties of shortcuts that may exist and execute these files can give you idea's of how to run them with working dir...

:whistle:

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
×
×
  • Create New...