Jump to content

Looking For Code To Run Program Via Start/run


Recommended Posts

I have a command that I am trying to run that works only when its run from the Start/RUN dialog via XP/2003

If I run it from a command prompt the program launches but gives an error. If I run it from the RUN Dialog it runs with no problem.

I dont need there to be any GUI or buttons. If I launch the AU3 script it should just simulate the below data. How can I do this?

I tried the below but its giving the same results as if its running from a command prompt.

Run("program.exe /s /d /fs /se g")

What code could I use to simulate it running from the Start/RUN Dialog box?

Many thanks,

MrChris

Link to comment
Share on other sites

What is the program and the error you get?

I can think of some programs that launch from Start/Run but not the command prompt (msconfig, winword) because of a registry setting that causes the run dialog to try to find the program....

; Worst-case woarkaround

Send("#r")

WinWait("Run")

ControlSetText("Run","","Edit1","program.exe /s /d /fs /se g")

ControlClick("Run","","OK")

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

Thanks for the fast reply,

Well heres the deal.

I use TrueCrypt v4.1 Here for data encryption. In adition I created a a file container in a ADS (NTFS Alternate Data Stream) inside the root of the drive. When I run the command TrueCrypt.exe /q /a /e /m rm /v :tcvolume If I run that command from a Command/DOS Prompt TrueCrypt opens but gives me an error that the file cannot be found. If I run it from the Start/Run Dialog it works just fine. So my objective is to plug this AU3/EXE into the AUTORUN.INF of the drive to process the command without any DOS windows ect.. opening. Make Sense?

Hope this helps,

Thanks again

MrChris

Link to comment
Share on other sites

When I use the above string in AUTORUN.INF I get an Open With dialog window when I double click on the drive.

Any other Ideas?

Thanks

MrChris

Try making a batch file (on the drive) that has that command in it and set the autorun to that.

(edit: http://www.truecrypt.org seems to be down atm for me...so i can't try this myself...)

Edited by evilertoaster
Link to comment
Share on other sites

Sounds like the same problem I had with ACDSee.

Use the run command from autoit or from a command line or a batch file and the program complains about missing files yet the Start/RUN Dialog box works.

My soln was to run a shortcut.

if ProcessExists("ACDSee5.exe") == 0 Then 
    Run(@ComSpec & " /c " & "aaa.lnk", "C:\Program Files\ACD Systems\ACDSee\5.0\",@SW_HIDE)
Else
    WinSetState('ACDSee 5.0','',@SW_RESTORE)
EndIf

While I can't run the exe directly I can run the lnk file.

aaa.lnk is just a shortcut to the exe file. For some reason spaces in the file name of the shortcut do not work. This shortcut is named aaa but needs to be referenced by aaa.lnk in the run command.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...