StMaSi Posted September 17, 2018 Share Posted September 17, 2018 Windows 10 Windows 7 AutoIT v3.3.14.2 I'm trying to compile a script that contains a run command with multiple quotes, but can't get it to run properly. However, even though it doesn't run successfully, I'm not seeing any error messages during compilation or execution. Here's what it looks like... Local $Program = Run(@ComSpec & ' /C SchTasks /Create /XML "%~DP0SetDefaultPDFReader.xml" /TN "\SetDefaultPDFReader" /RU "<domain\user>" /RP "<password>"',"",@SW_HIDE) I must have the quotes wrong, but I've tried every combination of single/double I could think of. Any suggestions? Thanx. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 17, 2018 Moderators Share Posted September 17, 2018 If you do something like this: ConsoleWrite(' /C SchTasks /Create /XML "%~DP0SetDefaultPDFReader.xml" /TN "\SetDefaultPDFReader" /RU "<domain\user>" /RP "<password>"' & @CRLF) Does the output look like what you would type into the CMD window? "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! Link to comment Share on other sites More sharing options...
StMaSi Posted September 17, 2018 Author Share Posted September 17, 2018 I get exactly the following output (without the surrounding brackets): [ /C SchTasks /Create /XML "%~DP0SetDefaultPDFReader.xml" /TN "\SetDefaultPDFReader" /RU "<domain\user>" /RP "<password>"] Thanx. Link to comment Share on other sites More sharing options...
StMaSi Posted September 17, 2018 Author Share Posted September 17, 2018 I see what it was now. AutoIT wasn't properly handling the "%~DP0" portion of the command. I changed that to "@ScriptDir" and now it's working perfectly. Thanx. Link to comment Share on other sites More sharing options...
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