Why won't this script work in Vista?

  • Thread starter Thread starter ToddAndMargo
  • Start date Start date
T

ToddAndMargo

Hi All,

This script works fine in w2k-pro and XP (both),
but not in Vista. Why and how do I fix it?

Many thanks,
-T

@echo off


set Target=C:\Program Files\Mozilla Firefox\searchplugins
if not exist "%Target%" goto Error

attrib -r "%Target%\*.*"
xcopy "SearchPlugins\*.*" "%Target%\." /Y
attrib -r "%Target%\*.*"
Goto end


:Error
echo Unable to locate
echo %Target%
pause
goto end

:end
 
Have you tried right clicking and choosing Run as administrator? You can't
write to the Program Files folder tree in Vista without elevating your
privileges.
 
Kerry said:
Have you tried right clicking and choosing Run as administrator? You
can't write to the Program Files folder tree in Vista without elevating
your privileges.

Tried running as administrator -- no joy.

How do I "elevate" my script's privileges?

-T
 
Put a pause statement after every line and step through the script one line
at a time. Where does the problem happen and what is the error message?
 
Note: Xcopy is now deprecated, please use Robocopy. Are you sure that source
exists and the relative path notation is correct in Vista?
 
Back
Top