efiftythree
IS-IT--Management
Im working on an HTA to aid in moving PC's from Novell to our MS domain. When completed the HTA will be burned to CD and carried around to the PC's to complete the migration.
There are six steps involved in the process and I have listed serveral of them below. One of the steps involves rebooting the PC once the Novell client has been removed. In that step I would like to include a registry write to make the HTA launch automatically upon restart. I thought I had this done but due to my lack of programming skills I wasnt aware of the restrictions on some Wscript things.
So, heres the code:
Sub Reboot is what I am concerned with. The code there dosnt work. Any ideas as to how I should solve this problem?
There are six steps involved in the process and I have listed serveral of them below. One of the steps involves rebooting the PC once the Novell client has been removed. In that step I would like to include a registry write to make the HTA launch automatically upon restart. I thought I had this done but due to my lack of programming skills I wasnt aware of the restrictions on some Wscript things.
So, heres the code:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled</title>
<HTA:APPLICATION
[stuff goes here]
/>
<SCRIPT Language="VBScript">
Sub NovellUninstall
Set WShell = CreateObject("WScript.Shell")
WShell.Run "c:\windows\system32\NetWare\nwmigw2k\SETUPW2K.exe /u ms_nwspx"
WShell.Run "c:\windows\system32\NetWare\nwmigw2k\SETUPW2K.exe /u ms_nwnb"
WShell.Run "c:\windows\system32\NetWare\nwmigw2k\SETUPW2K.exe /u ms_nwipx"
WShell.Run "c:\windows\system32\NetWare\nwmigw2k\SETUPW2K.exe /u nw_wm"
WShell.Run "c:\windows\system32\NetWare\nwmigw2k\SETUPW2K.exe /u nw_ndps"
WShell.Run "c:\windows\system32\NetWare\nwmigw2k\SETUPW2K.exe /u nw_nwfs "
End Sub
Sub VNCUninstall
Set WShell = CreateObject("WScript.Shell")
WShell.Run "c:\Progra~1\TightVNC\unins000.exe"
End Sub
Sub Reboot
DIM strPath
path = WScript.ScriptFullName ' script file name
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\RunDomHTA", strPath ,"REG_SZ"
Set WShell = CreateObject("WScript.Shell")
WShell.Run "shutdown -r"
End Sub
</SCRIPT>
</head>
<input id=unnovell class="button" type="button" value="Uninstall Novell" name="unnovell" onClick="NovellUninstall">
<input id=unvnc class="button" type="button" value="Uninstall VNC" name="unvnc" onClick="VNCUninstall">
<input id=reboot class="button" type="button" value="Reboot PC" name="reboot" onClick="Reboot">
</body>
</html>
Sub Reboot is what I am concerned with. The code there dosnt work. Any ideas as to how I should solve this problem?