Logon Script

  • Thread starter Thread starter Newbie
  • Start date Start date
N

Newbie

Hi,
I have a folder that contains shortcuts to a program based on the user's
network log on. What I would like to achieve is:

1. at logon the appropriate shortcut is copied to the users desktop

2. at logoff the shortcut is deleted

eg.

shortcuts filed in \\servername\shortcuts\username\shortcut

I want to copy this to the users desktop when the user logs on

How can I achieve this - I don't know about writing log on scripts so I will
need help with the syntax.
In order to avoid duplicate shortcuts when a user logs on will I have to
delete the original shortcut and recreate or will it just be written over
each time?

If I have to delete it - what would be the syntax for this?

Thanks
A
 
Thanks for that I have had a look but can't get it to work
Here is what I have:

Set WshShell = WScript.CreateObject("WScript.Shell")
Set oShellLink = WshShell.CreateShortcut("C:\Documents and
Settings\Joe.Smith\Desktop\CSC.lnk")
oShellLink.TargetPath = "c:\Program Files\CS\home\CSC.EXE" & " "
&"/HOST=192.168.0.16"
oShellLink.Save

The following message appears:
C:\Program Files\CS\home\CSC.EXE' is not accessible
This folder was moved or removed.
It then tries to search for the host 192.168.0.16

If I look at the shortcut that has been created the target path looks like
this:
"C:\Program Files\CS\home\CSC.EXE \HOST=192.168.0.16"

If I look at the shortcut that does work it looks like this in the target
path:
"C:\Program Files\CS\home\CSC.EXE" /HOST=192.168.0.16

How can I get this to work and how do I get this to run automatically on
login

Al
 
Newbie said:
If I look at the shortcut that has been created the target path looks like
this:
"C:\Program Files\CS\home\CSC.EXE \HOST=192.168.0.16"

If I look at the shortcut that does work it looks like this in the target
path:
"C:\Program Files\CS\home\CSC.EXE" /HOST=192.168.0.16

Try using the Arguments property.
how do I get this to run automatically on
login

You may be able to place it in the startup group, best to check it
manually first.
 
Back
Top