2x applicationserver client starting automatically
Hi Guys,
One possible solution to this is to use a login script to remove any shortcut in the startup folder under Document and Settings. Here's the script that will go through the all profiles (except for preditermined profiles). and delete the 2x applicationserver shortcut if it is located under the startup folder.
' VB Script to remove a designated file (default is ) located in the profile folder for every user on the
' system. There is provision for exempting certain folders via the constant ProtectedUsers which is set to a comma separated
' list which can be altered according to your requirements
'
' You should alter constant DeleteProtectedUsers from FALSE to TRUE to delete *ALL* copies of the file regardless of profile
'
'Credit - Spartacus
'
' URL:
http://www.appdeploy.com/messageboards/tm.asp?m=20594
'
'***********************************************************************************************************
Const FileToDelete = "2X ApplicationServer Client.lnk"
Const AllUsers = "\All Users"
Const DeleteProtectedUsers = "FALSE"
Const TemplatesFolder = "Start Menu\Programs\Startup"
Const ProtectedUsers = "Default User,Administrator,All Users,NetworkService,LocalService"
Dim oFSO, oWSH
Dim sAllUsersProfile, oAllUsersFolder, sProfilesRoot, oFolder
Dim colFSOSubFolders
Dim protuserarray
Dim DeleteFlag
On Error Resume Next ' this is set because the designated file may be locked from deletion
protuserarray = Split(ProtectedUsers,",")
' Instantiate the objects
Set oFSO = CreateObject("Scripting.FileSystemObject")
set oWSH = CreateObject("WScript.Shell")
' Get the Allusers profile folder path first and from this determine profiles parent folder
'
sAllUsersProfile = oWSH.ExpandEnvironmentStrings("%ALLUSERSPROFILE%")
Set oAllUsersFolder = oFSO.GetFolder(sAllUsersProfile)
sProfilesRoot = oAllUsersFOlder.ParentFolder
' Now enumerate all existing user profile folders
Set oFolder = oFSO.GetFolder(sProfilesRoot)
Set colFSOSubfolders = oFolder.Subfolders
' Now go through each existing user profile folder looking for the designated file to delete
For Each objSubfolder in colFSOSubfolders
DeleteFlag = "TRUE"
if oFSO.FileExists(sProfilesRoot & "\" & objSubfolder.Name & "\" & TemplatesFolder & "\" & FileToDelete) then
' Found the file, now establish whether containing folder is on the exempt list
if NOT DeleteProtectedUsers then
For Each element in protuserarray
if ucase(element) = ucase(objSubfolder.Name) then
DeleteFlag = "FALSE" ' mark this occurrence of the designated file as exempt from deletion
exit for
end if
Next
end if
If DeleteFlag then
' File was found in a folder that is not exempt, so go ahead and attempt to delete
oFSO.DeleteFile sProfilesRoot & "\" & objSubfolder.Name & "\" & TemplatesFolder & "\" & FileToDelete,TRUE
end if
end if
Next
' Clean up before exiting
set oFSO = Nothing
set oWSH = Nothing
Please note the above work is not my and i have given the person credit.
Ash.