apparition
13th January 2009 23:36 UTC
Execute VBscript (cscript) with arguments
I'm trying to execute a VBscript (nopwdexp.vbs) which I can do from command prompt:
cscript nopwdexp.vbs //B /domain:%computername% /user:master
And I'm trying pass the same script and the same arguments to execute in NSIS with little luck using Exec/ExecWait/nsExec.
ExecWait 'cscript "nopwdexp.vbs //B /domain:%computername% /user:master"'
Any help? I've tried adding the paths different combinations of syntax. Help!
Animaether
13th January 2009 23:57 UTC
you might be looking for...
ExecWait '"cscript" nopwdexp.vbs //B /domain:%computername% /user:master'
Basically, the outer ' quotes define the string for ExecWait to execute, while the inner " quotes are only there in case cscript were not just that command, but the command with full path - and the path might have spaces in it. Everything after that is the parameters (any spaces in -that- would have to be handled by the application's own spaces-in-parameters handling, which may or may not affect which quote marks you can use.