Batch files?


  1. Posts : 2
    window 7 64bit
       #1

    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 Computer


  2. Posts : 2
    window 7 64bit
    Thread Starter
       #2

    OK I've worked out a bit more :)

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

    @ECHO OFF
    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 Computer


 

  Related Discussions
Our Sites
Site Links
About 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 21:41.
Find Us