Go Back   Computer Forums > General Computing > Server Administration
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 08-05-2012, 08:35 PM   #1
Jsy
Baseband Member
 
Join Date: Dec 2005
Posts: 91
Default Creating a .bat script to move files

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!
__________________

__________________
3800x AMD, ASUS-E mobo, four 512 sticks of ddr400 (duel channels), Nvidia 7900gt OC, 80gig, 120gig, 200gig, 320gig, 400gig WDs, and a Soprano case
Jsy is offline   Reply With Quote
Old 08-07-2012, 11:07 AM   #2
In Runtime
 
lhamil64's Avatar
 
Join Date: Jan 2007
Posts: 398
Default Re: Creating a .bat script to move files

Quote:
Originally Posted by Jsy View Post
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 /?
__________________

__________________
--Lee
Website/Blog: http://lhamil64.wordpress.com
lhamil64 is offline   Reply With Quote
Old 08-07-2012, 01:20 PM   #3
Jsy
Baseband Member
 
Join Date: Dec 2005
Posts: 91
Default Re: Creating a .bat script to move files

So there isn't a way to push a file(s) out using AD or logon scripts to all the computers?
__________________
3800x AMD, ASUS-E mobo, four 512 sticks of ddr400 (duel channels), Nvidia 7900gt OC, 80gig, 120gig, 200gig, 320gig, 400gig WDs, and a Soprano case
Jsy is offline   Reply With Quote
Old 08-07-2012, 01:37 PM   #4
In Runtime
 
lhamil64's Avatar
 
Join Date: Jan 2007
Posts: 398
Default Re: Creating a .bat script to move files

Quote:
Originally Posted by Jsy View Post
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.
__________________
--Lee
Website/Blog: http://lhamil64.wordpress.com
lhamil64 is offline   Reply With Quote
Old 08-07-2012, 01:44 PM   #5
Jsy
Baseband Member
 
Join Date: Dec 2005
Posts: 91
Default Re: Creating a .bat script to move files

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!
__________________
3800x AMD, ASUS-E mobo, four 512 sticks of ddr400 (duel channels), Nvidia 7900gt OC, 80gig, 120gig, 200gig, 320gig, 400gig WDs, and a Soprano case
Jsy is offline   Reply With Quote
Old 08-20-2012, 10:47 AM   #6
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,001
Default Re: Creating a .bat script to move files

Quote:
Originally Posted by Jsy View Post
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
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 09-23-2012, 12:21 AM   #7
Baseband Member
 
Join Date: Sep 2012
Posts: 32
Default Re: Creating a .bat script to move files

If the end users have Windows Vista or 7, you can copy the file with Group Policy Preferences.
chris321 is offline   Reply With Quote
Old 09-25-2012, 06:14 PM   #8
In Runtime
 
WYSIWUG's Avatar
 
Join Date: Aug 2012
Location: New Zelaland
Posts: 381
Default Re: Creating a .bat script to move files

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
__________________

__________________
I hope that the world runs out of oil today so we can build a world free of hate and greed and money. Build one based on love and respect for all forms of life.
WYSIWUG is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 10:37 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0