Jump to content
Sign in to follow this  
MrBones

Ignore Characters, symbols within a function

Recommended Posts

MrBones

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,


Best regards,

Mr Bones

Share this post


Link to post
Share on other sites
spudw2k

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
MrBones

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.


Best regards,

Mr Bones

Share this post


Link to post
Share on other sites
MrBones

I'll give your example a try right now, spudw2k, could very well be that I've put them wrong.


Best regards,

Mr Bones

Share this post


Link to post
Share on other sites
MrBones

Excellent, the single quote works. Thank you. Still looking for that ignore symbol in question if anyone knows it. Or even if it exists.

In my memory of autoit I think it was there in earlier versions, than got removed.


Best regards,

Mr Bones

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  

×