Jump to content

What's wrong with this boot script?


Recommended Posts

Posted

Hi,

We are running through are numerous tidy up jobs after changing our whole domain and workstation setup.

I am having a real struggle trying to do the simplest of task, I think because there are so many of them!

 

I am trying to create a boot script that will copy files from \\Dc1\netlogon\_INF\SMTRAN\_ALL to c:\windows\start

 

this is to add any extra shortcuts to our users menu as an when they crop up.

 

However when my script runs - COPY "\\DC1\NETLOGON\_INF\SMTRAN\_All" "C:\WINDOWS\START\"

 

I get an error the system cannot find the file specified.

 

Can someone tell me what I am doing wrong?

 

Thanks

Posted
I could be wrong but i think batch files do not like to copy from UNC paths, when i used them in the XP days i mapped a network drive to the share first then did a net use * /delete at the end to disconnect the network drive.
Posted
Although I may have to take back some of the praise as that currently takes anything that is in the folder and removes it! I assume the /MIR switch at the end is to blame!
Posted

would a vbs script do the job, something like;

 

Set fso = CreateObject("Scripting.FileSystemObject")

fso.CopyFile "\\UNC_Path\File", "Dest_File",TRUE

Posted

Shortcuts, as in desktop short cuts to programs and network locations etc?

 

If you're using 2008 R2 and W7, why not look at the User Windows Preferences and set the short cuts from within GPO .. works here for me and you can target them to different users if you need to.

Posted (edited)
Although I may have to take back some of the praise as that currently takes anything that is in the folder and removes it! I assume the /MIR switch at the end is to blame!

 

do you mean in the destination folder? /mir will make it a exact replica of the source. You can change it if you want a merge. If you want to merge use this code

 

robocopy "\\DC1\NETLOGON\_INF\SMTRAN\_All" "C:\WINDOWS\START" /copy:d

 

Personally i wouldnt over complicate it with a VBS script.

Edited by FN-GM
Posted
Can I just thank all the guys who replied to this thread. Having a bad time at the moment here as there are loads of little niggles with our new system that are keeping us very busy. It's great to know that people out there are willing to help us without expecting anything in return!
  • Thanks 1
Posted
We do get something in return in a round about way - end up learning a few things and find other ways of doing the same thing. As FN GM stated - stick to robocopy as a script is not required and is over complicating it.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...