jamestubberville Posted April 1, 2009 Posted April 1, 2009 (edited) I recently updated AutoIT. All of my older scripts needed tweaking. I've been editing my scripts and have them complete with the exception of one. I've been using the RunAsSet to modify a few registry entries. RunAsSet has consolidated to RunAs. I can't get the script to update a remote registry. Local version of the script works: Case $msg = $Uncac RunAs(GuiCtrlRead($admin), @Computername, GUICtrlRead($password), 0, "REG add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system\ /v scforceoption /t REG_DWORD /d 0") WinWaitActive("C:\WINDOWS\system32\REG.exe") Send ("y") Send("{ENTER}") Remote Version Does not: Parameters: Script is run by a user. Script elevates priviledges to Admin. Script is stand alone and can not call other scripts or executables. User can not be added to the administrators group. Remote system name "$remote" is entered by the user as needed. Case $msg = $Uncac $string = "Reg add \\" & GuiCtrlRead($remote) & "\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system /v scforceoption /t REG_DWORD /d 0" RunAs(GuiCtrlRead($admin), GuiCtrlRead($remote), GUICtrlRead($password), 0, $string) WinWaitActive("C:\WINDOWS\system32\REG.exe") Send ("y") Send("{ENTER}") Need recommendations on elevating priviledges to edit registry or recommendation on elevating RegWrite to admin. Edited April 1, 2009 by jamestubberville
rajeshontheweb Posted April 1, 2009 Posted April 1, 2009 (edited) can you please wrap your code in [ autoit ] & [ / autoit ] tags it makes the script more readable and less space consuming. Also , just a doubt, why not user RegWrite - inbuilt autoit function is Reg Add superior to it? i'm just an amateur so just wondering if u had tried RegWrite, coz i felt more comfortable controlling autoit 'regwrite' than windows 'reg add' RegWrite( "\\"&GuiCtrlRead($remote) &"\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system","scforceoption","REG_DWORD "0") Can you check to see if this works for remote registry? because such statement works fine for me with local registry :-) Edited April 1, 2009 by rajeshontheweb Started late is much better than having never started it!!!!Failure is another step towards success. I've been messing around with: Adding Entry to 'Hosts'File Information Lister (Logger)Yet Another AutoIT Error Handler Yet Another AutoIT Error Handler & Debugger Control your App's TaskBar Button YCurrency Ticker (Latest Release : 16 Apr 2009)_WinInetInternetCheckConnection UDF Symantec Definitions Lister UDF _GetLocalIPAddresses UDF UDF to get Special Folder Information WMI_NetworkAdapterConfiguration2Array WMI_CDRomDriveCapabilities _ScriptExists - Check if your au3 script is running!! Uninstaller UDF Get Version for your application (at script level or compiled stage) Uninstaller Pro - faster alternative to windows application removal applet
jamestubberville Posted April 1, 2009 Author Posted April 1, 2009 Tried RegWrite; however, RunAs would not allow it to run. Kept receiving incorrect number of parameters error. The Format for RunAs is Runas(admin, computer, pw, flag, file). Inserting RegWrite( "\\"&GuiCtrlRead($remote) &"\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system","scforceoption","REG_DWORD "0") for file creates the parameter error. Is there a method to elevate RegWrite and keep the original requirements? I've looked to no avail.
Jim333 Posted April 22, 2009 Posted April 22, 2009 Tried RegWrite; however, RunAs would not allow it to run. Kept receiving incorrect number of parameters error. The Format for RunAs is Runas(admin, computer, pw, flag, file). Inserting RegWrite( "\\"&GuiCtrlRead($remote) &"\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system","scforceoption","REG_DWORD "0") for file creates the parameter error. Is there a method to elevate RegWrite and keep the original requirements? I've looked to no avail. Did anyone find a solution for this???
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