copy .bat from one computer to many computer

adiariyanto

New member
Local time
8:49 AM
Messages
2
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

Computer type
PC/Desktop
Computer Manufacturer/Model Number
HP
OS
Windows 7 Embedded
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

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Antec desktop; Acer Aspire laptops
OS
Windows 7 Professional 64-bit
CPU
Desktop i5; Acers i5 & i7
Memory
desktop 16GB; 1 Acer 8GB & 1 Acer 16GB
Hard Drives
1TB split into 2 equal partitions [OS and data] usable by RJS
Internet Speed
AT&T DSL
Browser
FF, GChrome, msIE
Other Info
Windows 7 Firewall, Emsisoft AM/AV, MSE [scan-only], SpywareBlaster, Ruiware/BillP combine
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

Computer type
PC/Desktop
OS
Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
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

Computer type
PC/Desktop
Computer Manufacturer/Model Number
HP
OS
Windows 7 Embedded
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

Computer type
PC/Desktop
OS
Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
Back
Top