Jump to content

Quotes


mattw112
 Share

Recommended Posts

I'm trying to get this script to work and having an issue with quotes I believe.

Basically I've tried every combination of Quotes, Double Quotes, single ticks, etc...

If I have a command like below it works(no quotes inside):

ShellExecuteWait(@ComSpec, '/c netsh advfirewall set allprofiles settings remotemanagement enable', @SystemDir, "", @SW_HIDE)oÝ÷ Ø­ò!j÷r¦jwpØjº^²)ì×¢¶¤zÆ®¶­se6VÆÄWV7WFUvB6öÕ7V2Âb33²ö2æWG6Gff&WvÆÂf&WvÆÂ6WB'VÆRw&÷WÙ4fÆRæB&çFW"6&æyBæWrVæ&ÆS×W2b33²Â77FVÔF"ÂgV÷C²gV÷C²Â5uôDRoÝ÷ Øý½æ¥²kçZºÚ"µÍÚ[^XÝ]UØZ]
ÛÛTÜXË  ][ÝËØÈ]ÚY]Ø[]Ø[Ù][HÜÝIÌÎNÑ[H[[Ú[ÉÌÎNÈ]È[XO^YÉ][ÝËÞÝ[Q   ][ÝÉ][ÝËÕ×ÒQJBÚ[^XÝ]UØZ]
ÛÛTÜXË  ][ÝËØÈ]ÚY]Ø[]Ø[Ù][HÜÝI][ÝäÑ[H[[Ú[É][Ýå]È[XO^YÉ][ÝËÞÝ[Q   ][ÝÉ][ÝËÕ×ÒQJBÚ[^XÝ]UØZ]
ÛÛTÜXË  ][ÝËØÈ]ÚY]Ø[]Ø[Ù][HÜÝIÌÎNÑ[H[[Ú[ÉÌÎNÈ]È[XO^YÉ][ÝËÞÝ[Q   ][ÝÉ][ÝËÕ×ÒQJ

I can run this command on the system from a cmd prompt and it works fine, so I know I have something messed up above.

Thanks,

Terry

Link to comment
Share on other sites

Try

ShellExecuteWait(@ComSpec, "/c Netsh advfirewall firewall set rule group=""File and Printer Sharing"" new enable=yes", @SystemDir, "", @SW_HIDE)
Link to comment
Share on other sites

  • Developers

you are sure this command works in a CMD window? :

Netsh advfirewall firewall set rule group=File and Printer Sharing new enable=yes

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I'm trying to get this script to work and having an issue with quotes I believe.

Basically I've tried every combination of Quotes, Double Quotes, single ticks, etc...

If I have a command like below it works(no quotes inside):

I can run this command on the system from a cmd prompt and it works fine, so I know I have something messed up above.

Thanks,

Terry

your second example looks right, but you use wrong double quotes... you need "" not “”

ShellExecuteWait(@ComSpec, '/c Netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=yes', @SystemDir, "", @SW_HIDE)
Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Im not sure because I'n on my XP lap top so i cant test it but this should work:

ShellExecuteWait(@ComSpec & "/c Netsh advfirewall firewall set rule group='File and Printer Sharing' new enable=yes", @SystemDir, "", @SW_HIDE)

edit nvm they are probably more correct than i am because i couldnt test it lol

Edited by Zmaster

A great place to start Autoit 1-2-3

Link to comment
Share on other sites

ProgAndy was right...

I guess form all my copying and pasting and moving stuff around from documents to Autoit the quotes were the wrong type?

So I needed "" not

Funny that the SciTE editor doesn't pick that up on the compile or at least give a warning or something. I'll pay attention in the future.

Thanks,

Terry

Link to comment
Share on other sites

  • Developers

Funny that the SciTE editor doesn't pick that up on the compile or at least give a warning or something. I'll pay attention in the future.

Why would it? It are just characters in a literal string. :)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...