chiners_68 Posted October 14, 2013 Posted October 14, 2013 I cant get the following to run. I think its an issue with the quotes etc. round the setup.exe and adminfile. any help appreciated run(@ScriptDir & '"setup.exe" /adminfile ' @ScriptDir & "profilesMAK-Passive.msp")
gruntydatsun Posted October 14, 2013 Posted October 14, 2013 (edited) i think the problem is in your " around the setup. as it is the command would resolve like: C:somefolder"setup.exe" /adminfile C:somefolderprofileMAK-Passive.msp try run('"' & @ScriptDir & 'setup.exe" /adminfile' & ' "' & @ScriptDir & 'profilesMAK-Passive.msp"') which should resolve to: "C:somefoldersetup.exe" /adminfile "C:somefolderprofilesMAK-Passive.msp" Edited October 14, 2013 by gruntydatsun
skysel Posted October 14, 2013 Posted October 14, 2013 (edited) Too much unnecessary quotes. This should be better + looks cleaner: Run(@ScriptDir & 'setup.exe' & ' /adminfile' & @ScriptDir & '\profiles\MAK-Passive.msp') I am not sure if .msp will run with Run command, if it doesn't, use ShellExecute instead. i think the problem is in your " around the setup. as it is the command would resolve like: C:somefolder"setup.exe" /adminfile C:somefolderprofileMAK-Passive.msp try run('"' & @ScriptDir & 'setup.exe" /adminfile' & ' "' & @ScriptDir & 'profilesMAK-Passive.msp"') which should resolve to: "C:somefoldersetup.exe" /adminfile "C:somefolderprofilesMAK-Passive.msp" Edited October 14, 2013 by skysel
Moderators JLogan3o13 Posted October 14, 2013 Moderators Posted October 14, 2013 Too much unnecessary quotes. This should be better + looks cleaner: Run(@ScriptDir & 'setup.exe' & ' /adminfile' & @ScriptDir & '\profiles\MAK-Passive.msp') I am not sure if .msp will run with Run command, if it doesn't, use ShellExecute instead. Your Run statement is incorrect, as you are missing the backslash before "setup.exe" "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
gruntydatsun Posted October 14, 2013 Posted October 14, 2013 (edited) The extra quotes are to cater for a @ScriptDir path that might have spaces in it like "C:Program Filesmorestuffin here" Stick with this Chiners_68run('"' & @ScriptDir & 'setup.exe" /adminfile' & ' "' & @ScriptDir & 'profilesMAK-Passive.msp"') Edited October 14, 2013 by gruntydatsun
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now