log on script - how?

G

Gavin

Hello.



Im trying to make a log on script to copy a file from a shared folder to a
users desktop when they log on. I have no idea how to do this. I have made
a batch file with the following in it:



copy \\Server\folder name\test.doc "c:\Documents and Settings\All
Users\Desktop\test.doc"



When i run it through the command promt i get 'The network path was not
found'



I set up a mapped drive, and used that instead of \\server and it works. Is
there anyway i can get it to work with the server name as not all users have
the drive mapped.



Thanks



Gavin.
 
P

Pegasus \(MVP\)

Gavin said:
Hello.



Im trying to make a log on script to copy a file from a shared folder to a
users desktop when they log on. I have no idea how to do this. I have made
a batch file with the following in it:



copy \\Server\folder name\test.doc "c:\Documents and Settings\All
Users\Desktop\test.doc"



When i run it through the command promt i get 'The network path was not
found'



I set up a mapped drive, and used that instead of \\server and it works. Is
there anyway i can get it to work with the server name as not all users have
the drive mapped.



Thanks



Gavin.

Try using double quotes everywhere, not just in some places:

copy /y "\\Server\folder name\test.doc" "c:\Documents and Settings\All
Users\Desktop"

Furthermore, naming the destination file can have undesirable
consquences. Just name the destination folder and let Windows
do the rest.

Use the /y switch to ensure that the file gets overwritten without
a user prompt, in case it already exists.

An even better idea would be to use this:

xcopy /y /d ... . ..

Start a Command Prompt and type xcopy /? to see the
meaning of the switches.
 

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