Creating a .bat script to move files

Jsy

Baseband Member
Messages
91
Hi guys,

I have a Windows 2008 server that needs to push out two files to all the other computers in their C drive. Considering this is my first .bat script is this the correct code?

move C:\test.txt C:\test.txt

or do I need something more elaborate? I do plan on pushing this out as a logon script.

Thanks!
 
Hi guys,

I have a Windows 2008 server that needs to push out two files to all the other computers in their C drive. Considering this is my first .bat script is this the correct code?

move C:\test.txt C:\test.txt

or do I need something more elaborate? I do plan on pushing this out as a logon script.

Thanks!

That command wont do anything, because you're moving the file to the same location that it currently is.
If this script will be run on the client machines, you will need to have a mapped drive to the location of the file on the server and then use that command to move (or copy) it to the local machine. You can see the correct parameters of the command by opening a command prompt and entering:
Code:
move /?
 
So there isn't a way to push a file(s) out using AD or logon scripts to all the computers?
 
So there isn't a way to push a file(s) out using AD or logon scripts to all the computers?

I'm not entirely sure, as I haven't worked with Windows Server too much. However, if you are doing this to send programs out to the connected computers, I know there's a specific way to deploy programs (like MS Office or something). Another option could be to share the directory on the server that has the programs you need the users to be able to access, then on the client machines you can access that shared location and, if you need to, write a script that can copy the files to a local folder.
I'd suggest looking up network sharing and drive mapping.
 
That seems to be the answer everyone is giving me. I was just wondering if there was a way to push out a file(s) to computers that would be picked up as soon as they logged or being pushed out by the server aside from a share drive so everything was automatic.


Thanks for the help!
 
Hi guys,

I have a Windows 2008 server that needs to push out two files to all the other computers in their C drive. Considering this is my first .bat script is this the correct code?

move C:\test.txt C:\test.txt

or do I need something more elaborate? I do plan on pushing this out as a logon script.

Thanks!

try
sharing a folder where the text file is on the server, (make a folder in the C drive, don't just share the root of the drive!)

then make your logon batch file
Code:
net use z: \\server\share 
copy z:\test.txt c:\test.txt
net use z: /delete
 
If the end users have Windows Vista or 7, you can copy the file with Group Policy Preferences.
 
Use the batch file to map a network drive to all the clients
Make the .bat and put it in the startup folder in the start menu or use it as a login script.

I.E

net use H: \\daniel\homedirs\nanotech
 
Back
Top Bottom