As part of our login script, there is a part to clean up the Start Menu for each user, as we have several Windows XP workstations running on a Windows Server 2003 network. Currently I'm using a batch file as the login script, but I'm in the process of converting it all to a VBScript, to allow for additional functionality in setting up Outlook and printers based on AD credentials.
The script should be able to:
1) Delete the Outlook Express shortcut, if found, from a user's Start Menu folder;
2) Delete the Sophos folder (if found) from the All Users Start Menu;
3) Set the Hidden attribute on both Startup folders; and
4) Sort the order of the Start Menu.
Attached is what I have so far this in a batch file; I am struggling to replicate this functionality in VBScript, but have encountered problems as I can't seem to find a way of accessing the %userprofile% equivalent in VBScript, just the absolute path (which obviously won't work for a login script).
if exist "%USERPROFILE%\Start Menu\Programs\Outlook Express.lnk" (
del /q "%USERPROFILE%\Start Menu\Programs\Outlook Express.lnk"
if exist "C:\Documents and Settings\All Users\Start Menu\Programs\Sophos\" (
rd /s /q "C:\Documents and Settings\All Users\Start Menu\Programs\Sophos\"
attrib +H "%USERPROFILE%\Start Menu\Programs\Startup\" /S
attrib +H "C:\Documents and Settings\All Users\Start Menu\Programs\Startup\" /S
REGPERM /K HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder /A:Everyone:R /Q