Need to copy a file or folder from Windows 2003 SBS to all network computers folder with a script.

I have about 35 workstations on a Windows 2003 Server domain. We are in the process of beta testing a new inventory program that he being developed by another company. So once a week we have a new version that is placed on our server remotely by this company and  I have to copy the new file to a directory on each client workstations C: Drive. Each directory is the same name of C:/2009_Code. Is there a way I can get a script to just copy the new file to every workstation when needed?
hcp27Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lee W, MVPTechnology and Business Process AdvisorCommented:
Add to the SBS LOGIN Script:

IF NOT EXIST "C:\2009_Code\NewFileName" COPY "\\Server\Share\Path\NewFile" "C:\2009_Code"

If the filename doesn't change but the version of the file does, I would use a marker file (a simple text file you copy with a different name each time)

IF NOT EXIST "C:\2009_Code\MarkerFileVersionXX" (
   COPY "\\Server\Share\Path\NewFile" "C:\2009_Code"
   COPY "\\Server\Share\Path\MarkerFileVersionXX" "C:\2009_Code"
)
0
hcp27Author Commented:
Could I do this without having it execute only when they log on and just manually execute when it needs to be done?
0
Lee W, MVPTechnology and Business Process AdvisorCommented:
You could, but I typically don't recommend it because machines could be off.  You could run a script as the domain admin that users a net view command to get machine names OR a text file with a list of machine names.  Assuming the text file path:

FOR /F "tokens=1" %%a in (machineNames.txt) DO (
   IF NOT EXIST "C:\2009_Code\MarkerFileVersionXX" (
      COPY "\\Server\Share\Path\NewFile" "\\%%a\c$\2009_Code"
      COPY "\\Server\Share\Path\MarkerFileVersionXX" "\\%%a\c$\2009_Code"
   )
)

The machine names text file would simply be one name per line and nothing else.

I prefer this with the login script because it's checked whenever the user logs in - especially for laptops, it helps ensure whenever the user does log in, they have access to the updated file.

If you have problems with your users STAYING logged in, then force a reboot with the SHUTDOWN command or DOWNLOAD the PSSHUTDOWN command from Microsoft.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hcp27Author Commented:
Yes thank you very much. That would work perfectly!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.