/build/static/layout/Breadcrumb_cap_w.png

.vbs script as a post installation task?

Hello, i am trying to run a .vbs script as a post install task in a winxp scripted installation, our company like to remove windows messenger and also the in built games, i have found the following scripts to do this:

remove games.vbs:
Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
sPrograms = WshShell.SpecialFolders("AllUsersPrograms")
If (Fso.FolderExists(sPrograms & "\Games")) Then
' Create file for uninstalling games
Set f = Fso.CreateTextFile("c:\windows\inf\wmdtocm.txt", True)
f.WriteLine("[Components]")
f.WriteLine("freecell=off")
f.WriteLine("hearts=off")
f.WriteLine("minesweeper=off")
f.WriteLine("msnexplr=off")
f.WriteLine("pinball=off")
f.WriteLine("solitaire=off")
f.WriteLine("spider=off")
f.WriteLine("zonegames=off")
f.Close
WshShell.Run "sysocmgr.exe /i:c:\windows\inf\sysoc.inf /u:""c:\windows\inf\wmdtocm.txt"" /q", 1, True
Fso.DeleteFolder(sPrograms & "\Games"), True
End If

---------------

Remove messenger.vbs:
'xp_messsenger_remove.vbs - Removes Windows Messenger from Windows XP
'© Doug Knox - 3/30/02
'Downloaded from www.dougknox.com

Option Explicit
On Error Resume Next

'Dimension variables
Dim WSHShell, MyBox, p1, q1, rcmd
Dim jobfunc

'Set the Windows Script Host Shell and assign values to variables
Set WSHShell = WScript.CreateObject("WScript.Shell")
p1 = "HKEY_LOCAL_MACHINE\Software\Microsoft\Outlook Express\Hide Messenger"
q1 = 2
rcmd = "RunDll32 advpack.dll,LaunchINFSection %windir%\inf\msmsgs.inf,BLC.Remove"

'Create or change the Hide Messenger value
WSHShell.RegWrite p1, q1

'Run the uninstall command
WshShell.Run(rcmd)

-----------------------------------------------

both run fine from a command prompt on a clean machine and also when double clicked, but when uploaded to the kbox with the command line: remove messenger.vbs / remove games.vbs respectively they do not run. i have tried this uploading the single files and also as a zip of the files.

would anyone be able to shed any light on this?

also is there a log of post installation failures? if so where would it be as this would help greatly.

0 Comments   [ + ] Show comments

Answers (2)

Posted by: riversidekid 13 years ago
Senior Yellow Belt
0
Most of my installs are just vb scripts. I usually set up a shutdown monitor so the user will find it difficult to shut down the machine while the install is running, then kick off any install sequence using a run statement with appropriate switches and then any 'clean up' statements. I started this because I needed to run something after the install just as you describe above; I kept doing it because I like consistency in my work. I can perform silent upgrades this way or a visible install with or without user interaction, vb is very flexible.

It's an art, not a science.
Posted by: trentderby 13 years ago
Blue Belt
0
figured it out, i needed to put the command line in quotation marks to install, all working ok now.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ