Medallyon

[Solved] Escaping Quote Character

5 posts in this topic

#1 ·  Posted (edited)

Heya AutoIt Community,

I'm sure this has been posted tons of times before, and I googled & forum'd it and found relevant topics, but none of these fixes apply to my particular code for some reason.

What I have right now:

ShellExecute("""" & $sProgramPath & """" & " !LoadLayout " & """" & $sLayout2 & """")

What I want to happen:

"C:\Program Files\Program\Program.exe" !LoadLayout "Working"

What actually happens:

Windows cannot find 'C:\Program Files\Program\Program.exe" !LoadLayout "Gaming'. Make sure you typed the name correctly, and then try again.

Of course the path is wrong because it has the wrong quotation marks!

I've used several methods trying to get normal quotes to appear in the programpath, like "", """" and even chr(34), but they all just return the above faulty @error message. How do I get it to look like what I want to happen?

Many Thanks in Advance,

~Admiral Medallyon

Edited by Medallyon
solved

Share this post


Link to post
Share on other sites



You should show all your code, I'm having trouble trying to figure out the word "Working" was transformed in to the word "Gaming".

$sLayout is an input from the user. It can be anything.

And where the single quotes magically appeared from.

That's why I posted this thread. I want to have it in the form

"C:\Program Files\Program\Program.exe" !LoadLayout "Working"

but it comes out as

'C:\Program Files\Program\Program.exe" !LoadLayout "Gaming'

because I cannot figure out the quotation. I was looking for help as to why my "s turned into 's.

Share this post


Link to post
Share on other sites

Medallyon,

Try this...

ShellExecute('"' & $sProgramPath & '"', " !LoadLayout " & $sLayout2)

Note: the 2ND parm of shellexecute is the parm(s).

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

Medallyon,

Try this...

ShellExecute('"' & $sProgramPath & '"', " !LoadLayout " & $sLayout2)

Note: the 2ND parm of shellexecute is the parm(s).

kylomas

This works flawlessly. Thank you very much for the quick input.

Regards,

~Admiral Medallyon

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

  • Similar Content

    • messilm10
      By messilm10
      how do i get the crash report of any application and any running script?????
    • ronaldo97
      By ronaldo97
      Hello How can I make the GUI is compatible with all screen sizes ??  
      #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 623, 445, 192, 124, BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZE)) GUISetBkColor(0x1E1E1E) $Label1 = GUICtrlCreateLabel("Welcome Back !!", 424, 64, 161, 29) GUICtrlSetFont(-1, 16, 400, 0, "Tahoma") GUICtrlSetColor(-1, 0x800000) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd How do I make Gui interface compatible with all screen sizes ?? 800*600
      1024*768
      1280*1024
    • messilm10
      By messilm10
      respected sir,
      how could I calculate the time difference using auto IT function ?
    • Xandy
      By Xandy
      Waxworks Code Wheel.
      Written in AutoIt with SDL.
      Source
    • mazz3d
      By mazz3d
      hello  everyone,
      I'm new with AutoIT and just looking for a way to open Firefox with random window size
      i have tried too many different samples from the web, some how it works but i can't make it works with Firefox 
      MozRpel and ff.au3 installed 
      right now i can open Firefox with this code, but i still can't control the window of Firefox
      ; open firefox #include <ff.au3> _FFStart() ; open firefox with random size