Jump to content

VISTA - UAC


Recommended Posts

Hey Everyone,

I'm having some problems with running a script in Vista. I'm trying to install McAfee, but the installation keeps saying "The requested operation requires elevation". I read the help file and included #requireadmin. I get a UAC elevation prompt when I launch the script, I click accept then receive the error. Here is my script:

; ----------------------------------------------------------------------------

#RequireAdmin

Opt("TrayIconDebug", 1)

; Variables In Use

$File = FileOpen(@TempDir & "\cd.txt", 0)

$CDRom = FileReadLine($File)

$McAfee = FileOpen("\\test.com\is$\install\Software\McAfee\dat.txt",0)

$Dat = FileReadLine($McAfee)

$IEexplorer = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer", "Version")

$DatNum = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\McAfee\ManagedServices\Agent\Components\VirusScanASaP", "szDatNum")

; ----------------------------------------------------------------------------

RunAsSet ("Username","Domain","Password")

If $IEexplorer <= 5.50 then

MsgBox(0,"Example Corporation", "Internet Explorer 6.0 is required. Please contact the IS Deparment")

Exit

EndIf

If FileExists (@ProgramFilesDir & "\McAfee\Managed VirusScan\VScan\McShield.exe") then

If $DatNum < $Dat Then

FileInstall("c:\vssetup.exe",@TempDir & "\vssetup.exe",@ProgramFilesDir)

Run(@TempDir & "\vssetup.exe /uninstall",@ProgramFilesDir,@SW_HIDE)

ProcessWaitClose("myAgtTry.exe")

RunWait(@TempDir & "\vssetup.exe /CK=xxxxxxxxxxxxxxxxx /Email=" & @Username & ".test.com",@ProgramFilesDir,@SW_HIDE )

ProcessWait("myAgtTry.exe")

Exit

EndIf

Else

FileInstall("c:\vssetup.exe",@TempDir & "\vssetup.exe")

Run("c:\temp\vssetup.exe /CK=xxxxxxxxxxxxxxxxx /Email=" & @Username & ".test.com",@ProgramFilesDir)

ProcessWait("myAgtTry.exe")

Exit

EndIf

Edited by JRFoster
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...