Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Batch files?

09 Apr 2015   #1

window 7 64bit
Batch files?

hello guys im new to this forum.

I'm trying to write a simple batch file which copies a couple of files from a network address to mulitple directories on the C:\ of different pc's

eg xcopy from lets say A:\source.file

to PC1 (directory user 1 folder, user 4 folder, user 7 folder, default)
to PC2 (directory user 2 folder, user 8 folder, user 9 folder, default)
to PC3 (directory user 3 folder, user 2 folder, user 1 folder, default)

basically there are 60 staff across a couple of offices and all i want to do is copy 2 desktop shortcuts across each active user desktop.

I'm alright up to copying it to the default directory, but short of speaking to IT and getting every single user name, wanting to know if there is a prompt to do a directory list and then copy to each actual folder?

i doubt i would be able to use the old school dir command, but open to any suggestions that may arise from other users.
My System SpecsSystem Spec
09 Apr 2015   #2

window 7 64bit

OK I've worked out a bit more :)

i did further googling and noticed the %homepath% variable.

xcopy b:12d_Model_10_64bit.lnk c:\%homepath%\Desktop /i /y
xcopy "A:\xxx\CAD\profiles\xxxx_ 2014.lnk" c:\%homepath%\Desktop /i /y
xcopy b:12d_Model_10_64bit.lnk C:\Users\Default\Desktop /i /y
xcopy "A:\xxx\CAD\profiles\xxxx_ 2014.lnk" C:\Users\Default\Desktop /i /y
xcopy b:12d_Model_10_64bit.lnk C:\Users\Public\Desktop /i /y
xcopy "A:\xxx\CAD\profiles\xxxx_ 2014.lnk" C:\Users\Public\Desktop /i /y

this allows me to copy files to the active user, the default profile and the public user so any new people will instantly get these files
My System SpecsSystem Spec

Thread Tools

Similar help and support threads
Thread Forum
Using .cmd Batch Files
I use RoboCopy in .cmd Batch files, is there a way to exit like "Exit Sub" in Visual Basic Is it possible to do Visual Basic like Logic Statements? Would it be possible to, within the batch file, determine whether a Drive Letter exists, Then run robocopy if it does?
General Discussion
batch files
Can I write simple batch files - example - at 3am xcopy server file to workstation a ?
batch renamming files
Hi, Does anyone know of a program or a fast way to rename filenames similar to this partial list 1bbea_set01_112432_019.jpg 1mbi5_set01_112432_016.jpg 3ppi_set01_112432_022.jpg 3scst_set01_112432_007.jpg 4chxb_set01_112432_017.jpg 5yvc5_set01_112432_006.jpg
General Discussion
Batch files and UAC
Hi. I have a small issue I hope can be resolved to a desired effect (if possible) Whats happening is, I am using a software, that to be used "correctly" requires a parameter to run correctly (2.0 beta type app) Heres what im looking at: The program is a neato reproduction of the HTC...
System Security
batch files - run as administrator
I am a software developer (dot net). Until recently I did all my work in the XP environment. I developed a utility library that goes into the global assembly cache. In the XP world this was easy. I write some .bat files that called the gacutil.exe and passed it the appropriate parameters. ...
General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 15:21.
Twitter Facebook