PDA

View Full Version : MS DOS Xcopy Batch File


Greg
December 5th 03, 12:33 AM
About seven years ago, I wrote a *.bat program that saves
updated files to a backup directory on my hard drive,
based on the current attribute for saved. The program
uses the DOS command "xcopy" in the code lines, using the
file attributes to decide whether the file is newly saved
and to save a backup. The batch file operates in an MSDOS
Window when it runs, saving files if the attribute "flag"
is "up", which indicates the data file has been saved
recently. After saving a file, the batch file then "puts
down" the attribute flag.

Recently my computer dealer recommended that I upgrade
from Windows 98 SE to Windows XP, but I am also told that
XP no longer has MSDOS Window feature.

Is this true? If so, does this means I cannot use my DOS
batch backup program any longer, or will it still run in
the Start > Run of the Task Bar?

I also understand that some of the new Windows operating
systems no longer have DOS incorporated in the code.

If I want to continue to use my xcopy backup program, will
it Run if I copy both my batch program and the Xcopy
command to the new system drive?

Jim Albright
December 5th 03, 12:33 AM
Windows XP does indeed have an xcopy.exe (modified for Windows XP and
resides in C:\windows\system32\). It also has a DOS window (run "cmd.exe"
not "command.com"). The archive bit in the flags still works. Autoexec.bat
and config.sys are replaced as they are in Windows NT 4.0 and Windows 2000
with autoexec.nt and config.nt.

Jim

"Greg" > wrote in message
...
> About seven years ago, I wrote a *.bat program that saves
> updated files to a backup directory on my hard drive,
> based on the current attribute for saved. The program
> uses the DOS command "xcopy" in the code lines, using the
> file attributes to decide whether the file is newly saved
> and to save a backup. The batch file operates in an MSDOS
> Window when it runs, saving files if the attribute "flag"
> is "up", which indicates the data file has been saved
> recently. After saving a file, the batch file then "puts
> down" the attribute flag.
>
> Recently my computer dealer recommended that I upgrade
> from Windows 98 SE to Windows XP, but I am also told that
> XP no longer has MSDOS Window feature.
>
> Is this true? If so, does this means I cannot use my DOS
> batch backup program any longer, or will it still run in
> the Start > Run of the Task Bar?
>
> I also understand that some of the new Windows operating
> systems no longer have DOS incorporated in the code.
>
> If I want to continue to use my xcopy backup program, will
> it Run if I copy both my batch program and the Xcopy
> command to the new system drive?
>

Ken Blake
December 5th 03, 12:33 AM
In , Greg wrote:


> Recently my computer dealer recommended that I upgrade
> from Windows 98 SE to Windows XP, but I am also told that
> XP no longer has MSDOS Window feature.
>
> Is this true?


Yes.


> If so, does this means I cannot use my DOS
> batch backup program any longer, or will it still run in
> the Start > Run of the Task Bar?


It may or it may not, depending on what commands it contains. XP
has a DOS emulator, and many DOS programs and batch files will
continue to work. You should try to find a friend with XP, and
try your batch file on his machine.

--
Ken Blake
Please reply to the newsgroup

Ken Blake
December 5th 03, 12:33 AM
In , Jim Albright wrote:

> Windows XP does indeed have an xcopy.exe (modified for Windows
XP and
> resides in C:\windows\system32\). It also has a DOS window (run
> "cmd.exe" not "command.com").


It's important to recognize that these (both cmd.exe and
command.exe) are DOS *emulators*, not true DOS. Some DOS
programs/commands work in them, but others don't.

--
Ken Blake
Please reply to the newsgroup


> The archive bit in the flags still
> works. Autoexec.bat and config.sys are replaced as they are in
> Windows NT 4.0 and Windows 2000 with autoexec.nt and config.nt.
>
> Jim
>
> "Greg" > wrote in message
> ...
>> About seven years ago, I wrote a *.bat program that saves
>> updated files to a backup directory on my hard drive,
>> based on the current attribute for saved. The program
>> uses the DOS command "xcopy" in the code lines, using the
>> file attributes to decide whether the file is newly saved
>> and to save a backup. The batch file operates in an MSDOS
>> Window when it runs, saving files if the attribute "flag"
>> is "up", which indicates the data file has been saved
>> recently. After saving a file, the batch file then "puts
>> down" the attribute flag.
>>
>> Recently my computer dealer recommended that I upgrade
>> from Windows 98 SE to Windows XP, but I am also told that
>> XP no longer has MSDOS Window feature.
>>
>> Is this true? If so, does this means I cannot use my DOS
>> batch backup program any longer, or will it still run in
>> the Start > Run of the Task Bar?
>>
>> I also understand that some of the new Windows operating
>> systems no longer have DOS incorporated in the code.
>>
>> If I want to continue to use my xcopy backup program, will
>> it Run if I copy both my batch program and the Xcopy
>> command to the new system drive?

LVTravel
December 5th 03, 12:34 AM
Greg. I use XCopy regularly to "update" the compact flash memory card (512
MB) that I take back and forth to work. Xcopy still works great in XP and
Win 2000 Pro since I use the same command options on both machines.

I recommend you check out the command line help for Xcopy once you get XP
loaded (or borrow another's machine). Click Start, Run and type CMD and
press enter. Type XCOPY /? and press enter. The help for xcopy will
appear. Click the maximize button and scroll up to see all of the help for
Xcopy. A few of the switches have been changed and others have been added
which really make Xcopy more useful than the one in 98.

I have a shortcut to the batch file and just double click on it from the
desktop to start my copy. A copy of my batch file is below. (BTW) I copied
Deltree from my old copy of ME and it works too. Just put it in my
Windows\System folder.


if exist P:\key.txt xcopy p:\document\*.* d:\document /e /c /i /h /r /y /d
/f
xcopy d:\document\*.* e:\document /e /c /i /h /r /y /d /f
xcopy e:\document\*.* d:\document /e /c /i /h /r /y /d /f
if exist p:\key.txt xcopy d:\document\*.* p:\document /e /c /i /h /r /y /d
/f
if exist g:\ksy.txt xcopy g:\document\*.* d:\document /e /c /i /h /r /y /d
/f
if exist g:\key.txt xcopy d:\document\*.* g:\document /e /c /i /h /r /y /d
/f
xcopy g:\r\*.* e:\f_drive_data\records /e /c /i /h /r /y /d /f
deltree /y g:\r



"Greg" > wrote in message
...
> About seven years ago, I wrote a *.bat program that saves
> updated files to a backup directory on my hard drive,
> based on the current attribute for saved. The program
> uses the DOS command "xcopy" in the code lines, using the
> file attributes to decide whether the file is newly saved
> and to save a backup. The batch file operates in an MSDOS
> Window when it runs, saving files if the attribute "flag"
> is "up", which indicates the data file has been saved
> recently. After saving a file, the batch file then "puts
> down" the attribute flag.
>
> Recently my computer dealer recommended that I upgrade
> from Windows 98 SE to Windows XP, but I am also told that
> XP no longer has MSDOS Window feature.
>
> Is this true? If so, does this means I cannot use my DOS
> batch backup program any longer, or will it still run in
> the Start > Run of the Task Bar?
>
> I also understand that some of the new Windows operating
> systems no longer have DOS incorporated in the code.
>
> If I want to continue to use my xcopy backup program, will
> it Run if I copy both my batch program and the Xcopy
> command to the new system drive?
>

Google