»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 11-14-2003, 04:56 PM   #1 (permalink)
Registered User
 
sixf00t4's Avatar
 
Join Date: Aug 2002
Location: Western PA
Posts: 2,296
sixf00t4 is on a distinguished road
Send a message via ICQ to sixf00t4 Send a message via AIM to sixf00t4 Send a message via Yahoo to sixf00t4
batch files in xp

i have a .bat file that just has "copy filename.txt c:\" in it, and it doesnt work. how can i copy a file with a script in xp?

__________________
[url=http://joshuadhall.com]My blog[/url]
sixf00t4 is offline   Reply With Quote
Old 11-18-2003, 06:05 AM   #2 (permalink)
Registered User
 
rpertusio's Avatar
 
Join Date: Nov 2002
Location: Hershey, PA
Posts: 1,013
rpertusio is on a distinguished road
Send a message via AIM to rpertusio
That batch file should work as is.

If you run it from a command prompt, what error messages does it tell you?

Also note, do NOT give the batch file a name such as 'copy' or any other known program name. If you name the batch file 'copy.bat', it will try to run itself, and go into an infinite loop (and never copy the file.)

- rp
rpertusio is offline   Reply With Quote
Old 11-18-2003, 06:21 AM   #3 (permalink)
Registered User
 
muno's Avatar
 
Join Date: Oct 2001
Location: Finland
Posts: 3,838
muno is on a distinguished road
Send a message via Yahoo to muno
the 'filename.txt' isn't probably where it's looking for it.
muno is offline   Reply With Quote
Old 11-18-2003, 10:39 AM   #4 (permalink)
Registered User
 
sixf00t4's Avatar
 
Join Date: Aug 2002
Location: Western PA
Posts: 2,296
sixf00t4 is on a distinguished road
Send a message via ICQ to sixf00t4 Send a message via AIM to sixf00t4 Send a message via Yahoo to sixf00t4
the .bat file is in the same directory as the filename.txt and i apologize for not listing the error. how newbie of me. it tells me that the syntax is wrong. but that is EXACTLY what i have in the file.
__________________
[url=http://joshuadhall.com]My blog[/url]
sixf00t4 is offline   Reply With Quote
Old 11-18-2003, 10:48 AM   #5 (permalink)
Registered User
 
Droppyale's Avatar
 
Join Date: Dec 2002
Location: -----------
Posts: 1,798
Droppyale is on a distinguished road
Send a message via AIM to Droppyale Send a message via Yahoo to Droppyale
maybe you need to specify the full path

"copy c:\blabla\filename.txt c:\"


have you tried that?
Droppyale is offline   Reply With Quote
Old 11-18-2003, 06:11 PM   #7 (permalink)
Registered User
 
davidamarkley's Avatar
 
Join Date: May 2002
Location: Joplin, MO
Posts: 2,208
davidamarkley is on a distinguished road
Send a message via ICQ to davidamarkley Send a message via AIM to davidamarkley
Remember the magical little . (dot)

You need to do something like this...

If the batch file, and the file to be copied are in the same directory(i.e., folder), then you can use this command, and no matter where the said batch and file are, it will work.

Code:
copy .\filename.txt C:\
HTH,

David

BTW, forgot to mention what the little magical . does for you. It is a way of saying look in the current directory. In other words, a wildcard for the folder that the batch file is in.
__________________
-David

Last edited by davidamarkley; 11-18-2003 at 06:14 PM.
davidamarkley is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 04:32 PM.