diff mbox

[KVM-AUTOTEST,2/7] KVM test: Batch script that prepares a Windows guest for remote access

Message ID 8ba0c835ecadb68d1f444e7cbb32a01d9c6dca3c.1249835925.git.mgoldish@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael Goldish Aug. 9, 2009, 4:51 p.m. UTC
setuprss.bat copies rss.exe to C:\, makes it run at startup, disables the
firewall, sets a known password for the administrator account, makes it logon
automatically, and does some Vista/2008 specific things.

The script requires administrator privileges.

Usage: setuprss.bat [full path to executable]
e.g.: setuptrss.bat D:\rss.exe

If used without parameters, rss.exe will be copied from the directory in which
setuprss.bat resides.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/deps/rss.reg      |   15 +++++++++++++++
 client/tests/kvm/deps/setuprss.bat |   19 +++++++++++++++++++
 2 files changed, 34 insertions(+), 0 deletions(-)
 create mode 100644 client/tests/kvm/deps/rss.reg
 create mode 100644 client/tests/kvm/deps/setuprss.bat
diff mbox

Patch

diff --git a/client/tests/kvm/deps/rss.reg b/client/tests/kvm/deps/rss.reg
new file mode 100644
index 0000000..b285d40
--- /dev/null
+++ b/client/tests/kvm/deps/rss.reg
@@ -0,0 +1,15 @@ 
+Windows Registry Editor Version 5.00
+
+[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run]
+"Remote Shell Server"="C:\\rss.exe 22"
+
+[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\winlogon]
+"AutoAdminLogon"="1"
+"DefaultUserName"="Administrator"
+"DefaultPassword"="1q2w3eP"
+
+[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System]
+"EnableLUA"=dword:00000000
+
+[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Reliability]
+"ShutdownReasonOn"=dword:00000000
diff --git a/client/tests/kvm/deps/setuprss.bat b/client/tests/kvm/deps/setuprss.bat
new file mode 100644
index 0000000..1e4b5a7
--- /dev/null
+++ b/client/tests/kvm/deps/setuprss.bat
@@ -0,0 +1,19 @@ 
+set rsspath=%1
+if [%1]==[] set rsspath=%~dp0\rss.exe
+copy %rsspath% C:\rss.exe
+
+net user Administrator /active:yes
+net user Administrator 1q2w3eP
+netsh firewall set opmode disable
+
+reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v "Remote Shell Server" /d "C:\rss.exe 22" /t REG_SZ /f
+reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\winlogon" /v "AutoAdminLogon" /d "1" /t REG_SZ /f
+reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\winlogon" /v "DefaultUserName" /d "Administrator" /t REG_SZ /f
+reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\winlogon" /v "DefaultPassword" /d "1q2w3eP" /t REG_SZ /f
+reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableLUA" /d "0" /t REG_DWORD /f
+reg add "HKLM\Software\Policies\Microsoft\Windows NT\Reliability" /v "ShutdownReasonOn" /d "0" /t REG_DWORD /f
+
+rem Just in case reg.exe is missing (e.g. Windows 2000):
+regedit /s %~dp0\rss.reg
+
+start /B C:\rss.exe