Re: Dos batch file ?
- From: Bill Watt <nobwatt@xxxxxxx>
- Date: Wed, 03 May 2006 22:20:51 -0400
Reply at end
On Fri, 28 Apr 2006 16:52:29 +1000, "Pegasus \(MVP\)"
<I.can@xxxxxxx> wrote:
"Bill Watt" <nobwatt@xxxxxxx> wrote in message
news:h7r252lt41c4aoi0gjni6mlc74nvbg5svd@xxxxxxxxxx
On Thu, 27 Apr 2006 15:54:21 +1000, "Pegasus \(MVP\)"
<I.can@xxxxxxx> wrote:
SNIP
I finally got to my Daughter's house and tried it.
Xcopy c:\"%UserProfile%\*.*" E:\Savedocs\ /c /e /h /k /y /d
I'm afraid you took some liberties here:
xcopy "%UserProfile%\*.*" (this is what I wrote)
Xcopy c:\"%UserProfile%\*.*" (this is what you wrote)
I'm sure you can see the difference.
I added C:\ because I have an exact copy of C: on E:. I'll change
it.
I get a message that Windows does not recognize it as a batch file.
I assume you placed your command into a batch file. What
is the name of the batch file? Where does it reside? How did
you invoke it?
I put the line in a Savedocs.bat file and put it in the root (C:\)
along with the 3 Xcopy files. I've d-clicked it from Windows
Explorer and also ran it from the CMD prompt. I'll rename the file,
it's the same name as the folder on E:
The %UserProfile% statement, is that an environment variable???
Could you explain that?
Can long file names and DOS short filenames be used in a batch file
and the CMD prompt?
SNIP
Thanks for the help. I'll probably get to try it on Monday.
Regards,
Bill Watt
Win98 Computer Help & Other Information http://home.ptd.net/~bwatt/
Environmental variables have not really changed since the old
DOS/Win98 days. They are invariably referenced with surrounding
% characters, e.g. %UserName%, %ComputerName%. To see
the full collection, type set {Enter} at the Command Prompt.
When you changed %UserProfile% to c:\%UserProfile%, you
effectively changed
c:\Documents and Settings to
c:\c:\Documents and Settings
which is obviously nonsense. I recommend you check all
your variables before you embed them in a batch file. The
command echo %UserProfile% will do it nicely.
Finally got an error "incorrect Dos version". Removed the 3 Xcopy
files I had copied from my machine and it worked fine. Created a
shortcut to the bat file on the Desktop. Did the same for their
pictures. They use it for business and they keep contracts in My
Documents and pictures of houses in another folder.
Thanks again.
Regards,
Bill Watt
Win98 Computer Help & Other Information http://home.ptd.net/~bwatt/
.
- Follow-Ups:
- Re: Dos batch file ?
- From: Pegasus \(MVP\)
- Re: Dos batch file ?
- Prev by Date: Re: Windows 2000 Freezes at startup.
- Next by Date: Re: Scandisk and Defrag.
- Previous by thread: Re: Log On
- Next by thread: Re: Dos batch file ?
- Index(es):
Relevant Pages
|