Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Batch File Question...
Old 10-29-2006, 09:48 AM Batch File Question...
Banned

Posts: 61
Name: Oh, don't go there
Location: United States
Trades: 0
Hi,

I need to know how I can copy a file to all hard drives on the computer from a batch file.

Tia
Frostydasnowman is offline
Reply With Quote
View Public Profile Visit Frostydasnowman's homepage!
 
 
Register now for full access!
Old 10-29-2006, 10:06 AM Re: Batch File Question...
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Code:
xcopy src_drive:\path\file.txt dest_drive:\path\ /y
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-29-2006, 10:40 AM Re: Batch File Question...
Banned

Posts: 61
Name: Oh, don't go there
Location: United States
Trades: 0
Actually, what I meant was I wanted to copy files to ALL the hard drives on the machine, even if they are network drives. I believe something like if exists C: GOTO USE_C? That's what I mean.

This is the actual command:

Code:
   IF EXIST E:\NUL GOTO USE_E
But that doesn't work in a 32-Bit / Network Enviorment.


Tia

Last edited by Frostydasnowman; 10-29-2006 at 11:19 AM..
Frostydasnowman is offline
Reply With Quote
View Public Profile Visit Frostydasnowman's homepage!
 
Old 10-29-2006, 03:22 PM Re: Batch File Question...
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Code:
@for %%d in (c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) do if exist %%d: xcopy scr_drive:\path\file %%d:\path\
Must be on a single line
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Batch File Question...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16298 seconds with 12 queries