Script to update desktop during logon isnt
I am working in an environment where a number of client computers are connected to windows server2003. I am not the administrator of this environment and don't really understand it, but I can get the administrator to do something if I ask. I
am working with a business application (in Access as it happens).
A predecessor of mine created a script (in vbs), which sits on each client computers C: drive and which runs at log on and copies the application to the local hard drive. One of the things this script does is update itself from a central location as
it runs.
I wrote an update to the script which attempts to create shortcut on the users desktop as well. I thoroughly tested it with me running the script by hand once I was already logged on, and it did successfully create the desktop icon.
I installed it into the central location and logged out and back in again, and the local copy of the script has definitely updated itself. I logged out and back in again and (since it is now the new version of the script and I would expected it to
do as tested) I am surprised it is NOT creating the desktop icon.
WHY? I am postulating that the log on scripts run before the desktop is updated from the server perhaps, but I can't find anywhere that explains the process and could confirm that. I am also not aware of where the individual users, or an All
Users users desktop sits.
I can connect directly to the server using RDS with the same credentials, and I can see where my desktop is coming from then, I can also see where my "My Documents" is coming from when I log on with a client computer.
The script uses
Set objShell = CreateObject("WScript.Shell")
strShortcut = objShell.SpecialFolders("Desktop") & "\" & Link
If objFSO.FileExists(strShortcut) Then
Set objFile = objFSO.GetFile(strShortcut)
objFile.Delete
Set objFile = Nothing
End If
' create shortcut
Set objLink = objShell.CreateShortcut(strShortcut)
to find the desktop and create the link.
Any ideas how to achieve what I want to do?
April 3rd, 2012 3:05pm
Assuming the script works correctly after logon, I see no reason why it would not work during logon. You say the script is saved locally, but run during logon. Is the local file specified as the logon script on the "Profile" tab of the user properties in
ADUC? Somehow this script updates itself from somewhere on the network during logon, and you can confirm that the local copy is correct? There are a number of places where normal users no longer can save files on newer operating systems, like "c:\Program Files"
and "c:\". I believe it is common to update shortcuts in logon scripts.
It is possible that the local version of the *.vbs file is no longer the copy that runs at logon. This would explain what you experience. First, check on the "Profile" tab in ADUC to see if the logon script is specified there and refers to the version
on the local c: drive. Next, perhaps the logon script has been specified in a Group Policy. One way to find all logon scripts on a domain controller, whether specified in a group policy or on the "Profile" tab of ADUC, is to search for all *.vbs files in the
sysvol folder, for example:
dir c:\Windows\sysvol\sysvol\*.vbs /s
Any folders with GUID values for names refer to group policies.
Richard Mueller - MVP Directory Services
Free Windows Admin Tool Kit Click here and download it now
April 3rd, 2012 6:50pm
In my scenario the script feupdate.vbs is stored in C:\Pas_front_end\ directory on each users local hard drive. The script itself replaces itself from a share \\ourserver\ourshare\front_end_script\feupdate.vbs. (obviously \ourserver\ourshare is a made
up name used just for this post - but I am sure you get the picture). I suppose if a copy of the script was running somewhere else that would explain why it hasn't, in reality changed.
As for the rest, I have had a poke about, but can't see anything. I will talk to the Administrator and see if I get anywhere with that.
Thanks for you help
April 3rd, 2012 7:26pm
you'd better go to Power Shell forum for better support.
http://social.technet.microsoft.com/Forums/en/winserverpowershell/threadsJeff Ren TechNet Community Support beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
May 7th, 2012 3:50am
I discovered what the problem was. the objShell.SpecialFolders("Desktop") was returning the desktop for the "default user", rather than "all users", so it appeared on one users desktop, but not on mine (because I was not the default user) when
I logged in.
May 7th, 2012 10:11am
you'd better go to Power Shell forum for better support.
http://social.technet.microsoft.com/Forums/en/winserverpowershell/threadsJeff Ren TechNet Community Support beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
May 7th, 2012 10:50am