Jump to content
Sign in to follow this  
StMaSi

Quotes

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

I get exactly the following output (without the surrounding brackets):

[ /C SchTasks /Create /XML "%~DP0SetDefaultPDFReader.xml" /TN "\SetDefaultPDFReader" /RU "<domain\user>" /RP "<password>"]

 

Thanx.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...