Jump to content
Sign in to follow this  
MrBones

Ignore Characters, symbols within a function

Recommended Posts

Ignore Characters, symbols within a function

-------------------------------

Hello, Mr Bones here.

Perhaps I have the wrong keywords to find this command. But let me produce the following string:

Local $pid = RunAsWait($sUserName, @ComputerName, $sPassword, 0, @ComSpec & " /c " & "psexec " & $ComputerName & " C:Program FilesMicrosoft OfficeOffice14Word.exe -noaddons", @SystemDir, @SW_SHOW)

Closely looking? Simply said its a psexec command I wish to perform on another computer. But when it comes to C:program files . I have an error feedback in dos that it says it cannot find C:program     

So I was thinking of using more double quotes, but that doesn't work. For it will only do beginning and end. I was looking for the symbol that will make Autoit interpret it as something to be ignored. I remember it might have been something like ^ but my old brain isn't as super as it used to be,

Share this post


Link to post
Share on other sites

One way to acomplish this--since you are using Autoit--You can use single quotes to define a string in Autoit.  I've used single quotes to define a string that has double quotes in it without consequence, but ther are other ways...this just happens to be an easy/lazy way of doing so.
 

Notice below I changed the double quotes surrounding C:Program....-noaddons to single then wrapped the path with double quotes.  Give that a shot.
 

Local $pid = RunAsWait($sUserName, @ComputerName, $sPassword, 0, @ComSpec & " /c " & "psexec \\" & $ComputerName & ' "C:\Program Files\Microsoft Office\Office14\Word.exe" -noaddons', @SystemDir, @SW_SHOW)
Edited by spudw2k

Share this post


Link to post
Share on other sites

In Dos the correct method would be

psexec %ComputerName% "C:Program FilesMicrosoft OfficeOffice14Word.exe" -noaddons

so I'm trying to input that command with the help of autoit. Doublequotes won't do the trick, single quotes I have attempted, but those are not picked up by autoIT or by the psexec command.

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  

×
×
  • Create New...