AndreasVliegen Posted May 20, 2006 Share Posted May 20, 2006 (edited) Hi ---------------------- I'm trying to use the Windows's netsh firewall syntax in AutoIt..This is my script so far:$ver = "v1.8.1" $installdir = RegRead("HKLM\SOFTWARE\Inloggen bij Teletop", "") $prog = $installdir & "\Inloggen bij Teletop " & $ver & ".exe" Run("netsh firewall add allowedprogram program = " & $prog & " name = ""Inloggen bij Teletop"" mode = ENABLE")Well this isn't working, it's hat got to do with the quotes ("), I don't know what's the right combination / order with the quotes...When I do it like this, it works... but i want it with the vars :Run("netsh firewall add allowedprogram program = ""D:\Program Files\Inloggen bij Teletop v1.8.1\Inloggen bij Teletop v1.8.1.exe"" name = ""Inloggen bij Teletop"" mode = ENABLE")The prog var is the good var.. the only problem are the quotes...Can somebody help me with this?Cheers,Andreas Edited May 20, 2006 by AndreasVliegen Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 20, 2006 Moderators Share Posted May 20, 2006 Did you try using "&" between the quotes?$ver = "v1.8.1" $installdir = RegRead("HKLM\SOFTWARE\Inloggen bij Teletop", "") $prog = $installdir & "\Inloggen bij Teletop " & $ver & ".exe" Run("netsh firewall add allowedprogram program = " & $prog & " name = " & "Inloggen bij Teletop" & " mode = ENABLE") Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
AndreasVliegen Posted May 20, 2006 Author Share Posted May 20, 2006 Did you try using "&" between the quotes?$ver = "v1.8.1" $installdir = RegRead("HKLM\SOFTWARE\Inloggen bij Teletop", "") $prog = $installdir & "\Inloggen bij Teletop " & $ver & ".exe" Run("netsh firewall add allowedprogram program = " & $prog & " name = " & "Inloggen bij Teletop" & " mode = ENABLE") That one isn't working Link to comment Share on other sites More sharing options...
Developers Jos Posted May 20, 2006 Developers Share Posted May 20, 2006 (edited) Parameters need to be quoted .... this should be close (untested): Run(@ComSpec & " /c netsh firewall add allowedprogram program = ""D:\Program Files\Inloggen bij Teletop v1.8.1\Inloggen bij Teletop v1.8.1.exe"" name = ""Inloggen bij Teletop"" mode = ENABLE") oÝ÷ Øè®f¥*ky÷«¶¬Á¬¢ºÞiÖX²jëh×6Run(@ComSpec & ' /c netsh firewall add allowedprogram program = "D:\Program Files\Inloggen bij Teletop v1.8.1\Inloggen bij Teletop v1.8.1.exe" name = "Inloggen bij Teletop" mode = ENABLE') Edited May 20, 2006 by JdeB 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 More sharing options...
AndreasVliegen Posted May 20, 2006 Author Share Posted May 20, 2006 Parameters need to be quoted .... this should be close (untested): Run(@ComSpec & " /c netsh firewall add allowedprogram program = ""D:\Program Files\Inloggen bij Teletop v1.8.1\Inloggen bij Teletop v1.8.1.exe"" name = ""Inloggen bij Teletop"" mode = ENABLE") I need it with variables, and this works, i know that already: Run("netsh firewall add allowedprogram program = ""D:\Program Files\Inloggen bij Teletop v1.8.1\Inloggen bij Teletop v1.8.1.exe"" name = ""Inloggen bij Teletop"" mode = ENABLE") But that is without the vars Link to comment Share on other sites More sharing options...
Developers Jos Posted May 20, 2006 Developers Share Posted May 20, 2006 Run(@ComSpec & ' /c netsh firewall add allowedprogram program = "' & $prog & '" name = "Inloggen bij Teletop" mode = ENABLE') 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 More sharing options...
AndreasVliegen Posted May 20, 2006 Author Share Posted May 20, 2006 Run(@ComSpec & ' /c netsh firewall add allowedprogram program = "' & $prog & '" name = "Inloggen bij Teletop" mode = ENABLE') Thank you! This one works! Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 20, 2006 Share Posted May 20, 2006 Run(@ComSpec & ' /c netsh firewall add allowedprogram program = "' & $prog & '" name = "Inloggen bij Teletop" mode = ENABLE') OK, give it up JdeB... how'd you get the syntax color coding to paste into your reply? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
pecloe Posted May 20, 2006 Share Posted May 20, 2006 he ain't tell'in Link to comment Share on other sites More sharing options...
Developers Jos Posted May 20, 2006 Developers Share Posted May 20, 2006 Just don't know.... I only know how SciTE does it... Jon is the expert web syntax highlighter .. 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 More sharing options...
PsaltyDS Posted May 21, 2006 Share Posted May 21, 2006 Just don't know.... I only know how SciTE does it...Jon is the expert web syntax highlighter .. I do all my AutoIT work in SciTE, and copy\paste to the forum from it all the time (like to hit the code with Tidy before posting it). I've never noticed the color coding preserved before. I also note your color coding was not preserved where I quoted it in my post... hmm... Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Developers Jos Posted May 21, 2006 Developers Share Posted May 21, 2006 I do all my AutoIT work in SciTE, and copy\paste to the forum from it all the time (like to hit the code with Tidy before posting it). I've never noticed the color coding preserved before. I also note your color coding was not preserved where I quoted it in my post... hmm... The color coding is not preserved from SciTE but when pasted in the forum post and you surround it with [ autoit] ... [ /autoit] in stead of [ code] ... [ /code] it will now be color coded with another php script. 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now