Logon Script

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
 
N

Newbie

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
 
G

Gerry Hickman

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top