Sign in to follow this  
Followers 0
Srv

_RunDos and netsh Vista

5 posts in this topic

Hi,

I'm trying to do this on a Vista box:

#RequireAdmin
#include <Process.au3>; Used by _RunDOS
$rc = _RunDOS("netsh firewall add portopening UDP 4500 ""UDP port 4500""")

Works fine on WinXP but in Vista it just doesn't dispite the fact that I'm using

#RequireAdmin

Any help is greatly appreciated!

TIA

Share this post


Link to post
Share on other sites



RequireAdmin prompts for UAC in Vista and is necessary to use to elevate privileges on Vista. See "AutoIT on Windows Vista" in bundle help file.

/Srv

Share this post


Link to post
Share on other sites

I found Windows Vista scritp elevation powertoys from Microsoft. Two files can be used to elevate privileges in Vista:

Download and extract: http://download.microsoft.com/download/f/d...lity2007_06.exe

elevate.cmd

elevate.vbs

Usage: elevate.cmd notepad.exe

So I thought I'd use the MS powertoy for elevating privileges...

Run(@ComSpec & " /C " & @ScriptDir & '\elevate.cmd Firewall.bat', "", @SW_HIDE); The batch file that configures Windows Firewall on XP and Vista

Even though I'm using @SW_HIDE, the Firewall.bat is not hidden. I can't seem to find the correct syntax for using "Start /MIN"

Maybe I'm just a newb ;o)

TIA

/SRV

Share this post


Link to post
Share on other sites

Arrh! :whistle:)

Nevermind my above reply...

It was too easy to fix.

Syntax for ShellExecute:

http://msdn2.microsoft.com/en-us/library/ms630455.aspx

So I edited the elevate.vbs to do this:

objShell.ShellExecute strApplication, strArguments, "", "runas", 2

I simply added "2" which minimizes the window as you can read in the above MS website.

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