Windows Vista Batch Files

  • Thread starter Thread starter Mike Harrison
  • Start date Start date
M

Mike Harrison

Guest
For many years I have been using a batch file to back up files later than a
specific date to a temporary directory. I then copy them to an external hard
drive. My new computer has Vista business. I am unable to get the batch file
to work. Would someone please help?

Old version
call xcopy c:\docume~1\mikeha~1\mydocu~1\*.* C:\temp3 /f /d:06-03-2008 /i /s

New version
call xcopy c:\users\mikeh\documents\*.* C:\temp3 /f /d:06-03-2008 /i /s
 
Re: Batch Files

Hi Mike,

The command xcopy was replaced with robocopy, alter your batch accordingly
and see if this helps.

--
Best of Luck,

Rick Rogers, aka "Nutcase" - Microsoft MVP
http://mvp.support.microsoft.com/
Windows help - www.rickrogers.org
My thoughts http://rick-mvp.blogspot.com

"Mike Harrison" <walker7729@hotmail.com> wrote in message
news:%23S7eGKM1IHA.2384@TK2MSFTNGP04.phx.gbl...
> For many years I have been using a batch file to back up files later than
> a specific date to a temporary directory. I then copy them to an external
> hard drive. My new computer has Vista business. I am unable to get the
> batch file to work. Would someone please help?
>
> Old version
> call xcopy c:\docume~1\mikeha~1\mydocu~1\*.* C:\temp3 /f /d:06-03-2008 /i
> /s
>
> New version
> call xcopy c:\users\mikeh\documents\*.* C:\temp3 /f /d:06-03-2008 /i /s
 
Re: Batch Files

Use this free utility instead MUCH easier :

http://www.karenware.com/powertools/ptreplicator.asp

"Mike Harrison" <walker7729@hotmail.com> wrote in message news:%23S7eGKM1IHA.2384@TK2MSFTNGP04.phx.gbl...
> For many years I have been using a batch file to back up files later than a
> specific date to a temporary directory. I then copy them to an external hard
> drive. My new computer has Vista business. I am unable to get the batch file
> to work. Would someone please help?
>
> Old version
> call xcopy c:\docume~1\mikeha~1\mydocu~1\*.* C:\temp3 /f /d:06-03-2008 /i /s
>
> New version
> call xcopy c:\users\mikeh\documents\*.* C:\temp3 /f /d:06-03-2008 /i /s
>
 
Re: Batch Files

"Rick Rogers" <rick@mvps.org> wrote in message
news:e7PmeOM1IHA.4492@TK2MSFTNGP02.phx.gbl...
> Hi Mike,
>
> The command xcopy was replaced with robocopy, alter your batch accordingly
> and see if this helps.



ROBOCOPY has been added as standard in Vista, rather than you having to add
it from the Resource Kit, but XCOPY is still in Vista, IIRC.

I think the reason for his script is not working is due to UAC not allowing
writes to the C: root? I can't test right now, but maybe the new folder
cannot be created by the command unless in an elevated prompt?

I agree he should convert to using ROBOCOPY instead though, as it has much
better features.

ss.
 
Re: Batch Files

Hi,

Run xcopy /? from a command prompt, you'll get:

NOTE: Xcopy is now deprecated, please use Robocopy.

Meaning it exists, but may not function correctly. If he created the temp3
folder, he should have full control on it and be able to write/alter files
there. However, if the folder was copied from a different installation, he
may need to alter permissions.

--
Best of Luck,

Rick Rogers, aka "Nutcase" - Microsoft MVP
http://mvp.support.microsoft.com/
Windows help - www.rickrogers.org
My thoughts http://rick-mvp.blogspot.com

"Synapse Syndrome" <synapse@NOSPAMsyndrome.me.uk> wrote in message
news:uzZhxXN1IHA.5728@TK2MSFTNGP06.phx.gbl...
> "Rick Rogers" <rick@mvps.org> wrote in message
> news:e7PmeOM1IHA.4492@TK2MSFTNGP02.phx.gbl...
>> Hi Mike,
>>
>> The command xcopy was replaced with robocopy, alter your batch
>> accordingly and see if this helps.

>
>
> ROBOCOPY has been added as standard in Vista, rather than you having to
> add it from the Resource Kit, but XCOPY is still in Vista, IIRC.
>
> I think the reason for his script is not working is due to UAC not
> allowing writes to the C: root? I can't test right now, but maybe the new
> folder cannot be created by the command unless in an elevated prompt?
>
> I agree he should convert to using ROBOCOPY instead though, as it has much
> better features.
>
> ss.
>
 
Re: Batch Files

"Rick Rogers" <rick@mvps.org> wrote in message
news:%23$$pxgN1IHA.2208@TK2MSFTNGP04.phx.gbl...
> Hi,
>
> Run xcopy /? from a command prompt, you'll get:
>
> NOTE: Xcopy is now deprecated, please use Robocopy.
>
> Meaning it exists, but may not function correctly.


I don't think it means that - it just means dissaproved in normal English.
It will still work the same, but in the future it will be deleted in later
versions of Windows, and its use is discouraged.

http://en.wikipedia.org/wiki/Deprecated

> If he created the temp3 folder, he should have full control on it and be
> able to write/alter files there. However, if the folder was copied from a
> different installation, he may need to alter permissions.


Okay. I remember that you cannot write directly to root, but was not sure
about creating folders on root without elevation.

ss.
 
Re: Batch Files

I have downloaded as you suggested. It sure looks like an excellent program.
Thank you for the advice.
"Spirit" <noone@notthere.net> wrote in message
news:uE0WzsM1IHA.3968@TK2MSFTNGP04.phx.gbl...
Use this free utility instead MUCH easier :

http://www.karenware.com/powertools/ptreplicator.asp

"Mike Harrison" <walker7729@hotmail.com> wrote in message
news:%23S7eGKM1IHA.2384@TK2MSFTNGP04.phx.gbl...
> For many years I have been using a batch file to back up files later than
> a
> specific date to a temporary directory. I then copy them to an external
> hard
> drive. My new computer has Vista business. I am unable to get the batch
> file
> to work. Would someone please help?
>
> Old version
> call xcopy c:\docume~1\mikeha~1\mydocu~1\*.* C:\temp3 /f /d:06-03-2008 /i
> /s
>
> New version
> call xcopy c:\users\mikeh\documents\*.* C:\temp3 /f /d:06-03-2008 /i /s
>
 
Re: Batch Files

I ran a test using both commands as the OP wrote them and it worked fine in
both cases, but I created the temp2 folder myself from an elevated prompt.
That's why I suspect it may be a permissions issue, but there is still the
possibility that something on the user's system is causing a problem with
xcopy, so that's why I suggested trying robocopy first.

--
Best of Luck,

Rick Rogers, aka "Nutcase" - Microsoft MVP
http://mvp.support.microsoft.com/
Windows help - www.rickrogers.org
My thoughts http://rick-mvp.blogspot.com

"Synapse Syndrome" <synapse@NOSPAMsyndrome.me.uk> wrote in message
news:uiAKCuN1IHA.548@TK2MSFTNGP06.phx.gbl...
> "Rick Rogers" <rick@mvps.org> wrote in message
> news:%23$$pxgN1IHA.2208@TK2MSFTNGP04.phx.gbl...
>> Hi,
>>
>> Run xcopy /? from a command prompt, you'll get:
>>
>> NOTE: Xcopy is now deprecated, please use Robocopy.
>>
>> Meaning it exists, but may not function correctly.

>
> I don't think it means that - it just means dissaproved in normal English.
> It will still work the same, but in the future it will be deleted in later
> versions of Windows, and its use is discouraged.
>
> http://en.wikipedia.org/wiki/Deprecated
>
>> If he created the temp3 folder, he should have full control on it and be
>> able to write/alter files there. However, if the folder was copied from a
>> different installation, he may need to alter permissions.

>
> Okay. I remember that you cannot write directly to root, but was not sure
> about creating folders on root without elevation.
>
> ss.
>
 
Back
Top