- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2009 09:59 PM
I often need to connect to a remote registry using regedit to check settings etc. I couldn't figure out how to do it from the command line (if someone knows, please share!), so I wrote a quick AutoIT script to do it. Convert to .exe, copy to a suitable location and create the following custom action:
Have attached the .exe to this post for others to use. The AutoIT code is below.
;
; AutoIt Version: 3.3
; Language: English
; Platform: Win2000/XP/Vista/2008
; Author: Michael Ward
;
; Script Function:
; Connects to a remote registry using regedit
;
#requireadmin
if ($CmdLine[0] > 0) Then
$hostname = $CmdLine[1]
Else
MsgBox(48,"Error","No Hostname Specified",60)
Exit(1)
EndIf
; Run Regedit
Run("regedit.exe")
; Wait for the regedit to become active
WinWaitActive("Registry Editor")
; Connect to the remote registry
Send("!f")
Send("c")
WinWaitActive("Select Computer")
Send($hostname)
Send("{ENTER}")
; Finished!
Action:
{actionpath}remote_regedit.exe {smartname}
- Labels:
-
Custom Actions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2015 01:05 PM
When choose a asset and Regsitry on the let site which is the name of above command first i get UAC message i use then YES for yes permissions to do but then nothing happens..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2015 10:23 PM
If I run regedit manually I get a UAC warning asking if I want to allow regedit to make changes to this computer. Picking 'Yes' gives me full registry access with all the keys showing. Running it from the compiled script I don't get prompted and only a few keys are readable.
It's like #requireadmin needs to be turned down a notch. Any suggestions?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2015 03:56 PM
sc \\<pcname> start "RemoteRegistry"
But being the tweaking-kind; I added a line to the autoIT script that does it automatically.

It goes before the Run Regedit line like this:-
;
; AutoIt Version: 3.3
; Language: English
; Platform: Win2000/XP/Vista/2008
; Author: Michael Ward
;
; Script Function:
; Connects to a remote registry using regedit
;
#requireadmin
if ($CmdLine[0] > 0) Then
$hostname = $CmdLine[1]
Else
MsgBox(48,"Error","No Hostname Specified",60)
Exit(1)
EndIf
; Start up Remote Registry access
RunWait('sc.exe '&$hostname&' start "RemoteRegistry"')
; Run Regedit
Run("regedit.exe")
; Wait for the regedit to become active
WinWaitActive("Registry Editor")
; Connect to the remote registry
Send("!f")
Send("c")
WinWaitActive("Select Computer")
Send($hostname)
Send("{ENTER}")
; Finished!
You then need to change the action line to put in the two backslashes in front of the PC name:-
{actionpath}remote_regedit.exe \\{smartname}
A big thank you to Michael for the script in the first place (and Dan for the admin line!)!


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2014 08:27 AM
Our clients have Windows 7 Prof. x64 installed.
All times come the error message: No Hostname Specified
What i can do ??

Sorry for my bad english 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2014 05:07 PM
Finally found how to make it work!
#RequireAdmin
Specifies that the current script requires full administrator rights to run.
I just put #RequireAdmin at the top of the AutoIT script and made a new executable
Thanks to Michael Ward for creating this script

;
; AutoIt Version: 3.3
; Language: English
; Platform: Win2000/XP/Vista/2008
; Author: Michael Ward
;
; Script Function:
; Connects to a remote registry using regedit
;
if ($CmdLine[0] > 0) Then
$hostname = $CmdLine[1]
Else
MsgBox(48,"Error","No Hostname Specified",60)
Exit(1)
EndIf
; Run Regedit
Run("regedit.exe")
; Wait for the regedit to become active
WinWaitActive("Registry Editor")
; Connect to the remote registry
Send("!f")
Send("c")
WinWaitActive("Select Computer")
Send($hostname)
Send("{ENTER}")
; Finished!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2011 12:50 PM
I've adapted this for my Altiris DS console so that I can right click on the computer in the DS console and access the registry directly.
If you don't want the options embedded, it'd be relatively simple to read an ini file with iniread($inifile, "Settings", "OnePCPerWindow, "Y")
Please don't laugh too hard at my hideous coding 🙂
;
; AutoIt Version: 3.3
; Language: English
; Platform: Win2000/XP/Vista/2008
; Author: Michael Ward
; Modification by Gerard Sweeney, 2011
;
; Script Function:
; Connects to a remote registry using regedit
;
; Choices here - if you don't want multiple PCs open in the one
; regedit window, we can present some choices
; OnePCPerWindow - Close Regedit first before opening the specified PC
; Prompt - Ask the user if they want to close regedit first
; Note that setting OnePCPerWindow to "N" over-rides $Prompt
$OnePCPerWindow = "N"
$Prompt = "Y"
if ($CmdLine[0] > 0) Then
$hostname = $CmdLine[1]
Else
MsgBox(48,"Error","No Hostname Specified",60)
Exit(1)
EndIf
$P = "regedit.exe"
$T = "Registry Editor"
; Run Regedit if it isn't already running
If ProcessExists($P) <> 0 then
If $OnePCPerWindow = "Y" then
If $Prompt = "Y" then
$Q = Msgbox(35, "Regedit already open", "Regedit is already running." & @CRLF & @CRLF & "Do you want to open the registry for PC " & $HostName & " in this window?" & @CRLF & @CRLF & "Yes = Open in current window" & @CRLF & "No = Close current Regedit window first" & @CRLF & "Cancel = do not attempt to open the remote registry at all")
Select
Case $Q = 7
; No clicked
ProcessClose($P)
ProcessWaitClose($P,10)
Case $Q = 6
; Yes clicked
Case Else
; Cancel
EXIT
EndSelect
Else
ProcessClose($P)
ProcessWaitClose($P,10)
EndIf
EndIf
EndIf
If ProcessExists($P) = 0 then
Run($P)
; Wait for the regedit to become active
WinWaitActive($T)
EndIf
WinActivate($T)
WinWaitActive($T)
; Connect to the remote registry
Send("!f")
Send("c")
WinWaitActive("Select Computer")
Send($hostname)
Send("{ENTER}")
; Finished!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2009 07:17 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2009 08:49 PM


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2009 02:31 PM
/L:system Specify the location of the system.dat to use
/R:user Specify the location of the user.dat to use
I would imagine pointing those to the (admin share + appropriate path) on the remote computer would do the trick.
