Jump to content

Script Problem


 Share

Recommended Posts

I'm trying to use the following to run a registry update from a PC where the logged in person only has user rights. The "Registry Editor" dialog box comes up, but the ControlClick doesn't seem to take effect.

**********************************************************

If Not IsAdmin() Then

RunAsSet('administrator', @Computername, 'krispy')

EndIf

FileCopy("Z:\Client\Windows Update.reg", "C:\Novell\",1)

FileCopy("Z:\Client\RegUpdate.bat", "C:\Novell\",1)

Run("C:\Novell\RegUpdate.bat", "", @SW_HIDE)

Opt("WinSearchChildren", 1)

WinActivate("Registry Editor")

Opt("MouseClickDelay", 10)

ControlClick("Registry Editor", "", 6, "", 1)

;FileDelete("C:\Novell\Windows Update.reg")

;FileDelete("C:\Novell\RegUpdate.bat")

Exit

Edited by cpremo
Link to comment
Share on other sites

I imagined that.

I suppose your batch file is running the reg one - right?

As I said - I'm not sure about if the RunAsSet at the begining of your script extends this to EVERYTHING you will run within your script - so it looks like a good idea to run everything inside using RunAsSet.

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

RunAsSet() function only work for the Run() and Runwait() functions. The best way to do what you want is.

If Not IsAdmin() Then
   RunAsSet('administrator', @Computername, 'krispy')
EndIf

FileCopy("Z:\Client\Windows Update.reg", "C:\Novell\",1)
RunWait(@ComSpec & ' /c regedit /s "C:\Novell\Windows Update.reg"', @SystemDir, @SW_HIDE)
AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
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...