copy .bat from one computer to many computer


  1. Posts : 2
    Windows 7 Embedded
       #1

    copy .bat from one computer to many computer


    Hi..
    i would like to know if somebody ever done before
    I need to replace login.bat file that locate in C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp in 96 computer with new login.bat that I have.

    I already use xcopy and copy command but it need administrator access / password.
    is there any script / bat file / a way to do this ?
    all administrator password account is same and I have it.
      My Computer


  2. Posts : 2,774
    Windows 7 Professional 64-bit
       #2

    I have to rush off to work, however, you can get from here Take Ownership REG script and/or Run As Administrator REG script. I mean the folks here can tell you where to find, how to activate, how to use those two scripts.
      My Computer


  3. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #3

    Hi Adiariyanto,

    I'm not entirely knowledgeable about networks, but it shouldn't be hard to whip up a file replace batch script.

    Something like...
    Code:
    @echo off
    for /f "usebackq delims=" %%I in ("C:\networkcomputers.txt") do (
    xcopy "\\%COMPUTERNAME%\C$\some\path\to\logon.bat" "\\%%~I\C$\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup" /y
    )
    Should get the job done. With "C:\networkcomputers.txt" being a newline-separated list of all 96 network computers.
      My Computer


  4. Posts : 2
    Windows 7 Embedded
    Thread Starter
       #4

    Pyprohly said:
    Hi Adiariyanto,

    I'm not entirely knowledgeable about networks, but it shouldn't be hard to whip up a file replace batch script.

    Something like...
    Code:
    @echo off
    for /f "usebackq delims=" %%I in ("C:\networkcomputers.txt") do (
    xcopy "\\%COMPUTERNAME%\C$\some\path\to\logon.bat" "\\%%~I\C$\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup" /y
    )
    Should get the job done. With "C:\networkcomputers.txt" being a newline-separated list of all 96 network computers.
    Hi Pyprohly

    I try copy your script into notepad and make it .bat file , but it doesnt work ? do I miss something ? I try run your script as administrator, but in target computer the .bat file does not copied..
    then I try remove /y
    and got an error %%I was unexpected at this time..
      My Computer


  5. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #5

    I would like to reiterate, I'm no network guru. But if you'd like to stick around I'd be happy to work with you in finding a solution.


    Do you have a remote computer you can test with? Get it ready.

    Verify that you have access to this computer's Startup directory by listing it's contents.
    Code:
    dir "\\ComputerName\C$\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup"
    Substituting "ComputerName" with the name of the computer you decide to perform testing on.


    If you accomplished the above with success, take matters to the next step and make an attempt to Xcopy some arbitrary file on your local computer to the remote computer's Startup folder with the following,
    Code:
    xcopy "C:\Some\random\file\on\your\machine.txt" "\\ComputerName\C$\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup"
    Again, substituting "ComputerName" accordingly.



    Post back with your findings.
      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 19:53.
Find Us