Sign in to follow this  
Followers 0
mattw112

Quotes

9 posts in this topic

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

Share this post


Link to post
Share on other sites



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

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

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

I agree with ProgAndy here.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

I think the command line interpreter generally chokes on single quotes.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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. :)

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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  
Followers 0