Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying files in DOS???? 3

Status
Not open for further replies.

jstar7

Programmer
Dec 17, 2002
61
GB
Hi there,

I had a problem with a restart loop after install of Win2K. Finally got to the root of the problem and it turns out I need to upload a file that was corrupt. So now Ive got a new copy of the file on my USB pen(cos its 1.8mb) and I'm sittin in DOS. Basically I need to copy the file from USB pen to folder in C drive...from DOS. Any ideas?

I am at the prompt A:\ and need to put the file into C:\Windows\System32\

please help!!


-------------------------------------------------

 
Well the DOS command should really be
A:\copy filename C:\WINNT\System32\

unless you are not using WINDOWS 2000 or have renamed the default folder, other wise the command bcastner suggested will create a folder"s" as he typed in c:\windows\system32\ and will place your file as well, and will be of no use to you.

Remember, DOS stands for DUMB Operating System

Computers are like a bag of hammers, they won't do a damn thing until you pick it up and SMASH something with it!!
 
Brimestone's correction accepted.

This however "Remember, DOS stands for DUMB Operating System."

There still are a ton of us old-timers writing .bat and .cmd files and would argue with you.
 
Hello Brimestone,

I am not sure your line is correct?! Without the backslash for a well-known exisitng directory as destination for copying a definitive file without wildcard is no problem at all, and should be so if you want to keep the same name as the source file. (With wildcard in the source, it is different.) So I think the line posted by bcastner is okay.

regards - tsuji
 
His correction was C:\winnt\ vs C:\windows\ as the path. The original poster requsted to copy to C:\WINDOWS\ however so Bcastner provided the correct COPY syntax.

If "System32" did not exist within "c:\windows" then the file copied would become the new "System32". If "c:\windows\" did not exist (the user installed by default c:\winnt\) then no files would be copied as the destination does not exist. COPY will not create a new directory, XCOPY can if it exists in the source path hierarchy.

Now the bigger problem will be this user getting access to the USB drive from DOS, and someone already suggested where he can get a boot disk for that.

Nathan aka: zaz (zaznet)
zaz@zaz.net
 
Hello zaznet,

Your point is taken. (xp revert to windows whereas 2k is winnt). I will let user to figure out the final folders.

My concern is the backslash added. With it, it can fail.

regards - tsuji
 
Right, I never add the trailing \ on a destination path as the folder name is the _destination_.

Nathan aka: zaz (zaznet)
zaz@zaz.net
 
Thanks to Forum members tsuji and zaznet for coming to my defense.

But member Brimstone is going to get a well deserved whack on the head if he intends to continue to pick on DOS under Win2k or XP.

I absolutely love the scripting engine and features that Microsoft has made available under any modern version of Windows. Being able to write either in java or vbs is just great.

But you will have to cut my right arm off before I stop using .bat or .cmd scripting as well.



 
Indeed! Even VBS has options so you can go in console mode or gui.

Tonight (well I started work yesterday) I am mumbling the dueling banjo theme in my head as my co-worker runs a service check .VBS on the same 1,900 server list as my .CMD runs. Both outputing the equivelant CSV files.

Mine is a tad faster so far, and doesn't crash half way through the list. On the down side I'm eating up threads (spawning find's and sc's) so I could jam up later on. :)

Nathan aka: zaz (zaznet)
zaz@zaz.net
 
zaznet,

Be sure to remember and post the final results.

 
OH! Don't get me wrong, I didn't say "I didn't like DOS". I love the clacking sound of my keyboard as I type the commands to my computer. DOS level computing is near a lost art, my reference to Dumb Operating System isn't out of context though. To use DOS, YOU have to do all the "THINKING" for it to work :)

PS You are correct tsuji, That command will not work with latest versions of windoz, however it will work with DOS ver 3.0 - 6.0.

I must have been using the DUS prompt " DUMB USER SYSTEM " *sigh*

Computers are like a bag of hammers, they won't do a damn thing until you pick it up and SMASH something with it!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top