Windows 7 Copy help

September 9, 2011 at 18:31:52
Specs: Win 7 Ultimate , 4.17Ghz 8GB ram

When using the line below i get an error saying that the system cannot find the specified path.
if I dont run the script in administrator mode it says access denied.

Im not sure why it is doing this. It works fine in XP
It is transferring from a flash drive. so i have to use the .\ and cannot use a specific path.

copy /Y ".\DATA\upmbam\ignore.dat" "C:\Users\All Users\Malwarebytes\Malwarebytes' Anti-Malware"


See More: Windows 7 Copy help

Report •

#1
September 10, 2011 at 07:12:02
My guess: You're elevating the script with UAC. If that's the case, it'll probably set your working directory to %systemroot%\system32.

How To Ask Questions The Smart Way


Report •

#2
September 10, 2011 at 07:20:21
Im just right clicking on it and pushing run as administrator.

I think the problem is that its coping it from a flash drive. Because if I try and copy the file from a local directory it works fine.


Report •

#3
September 10, 2011 at 07:42:31
"Run as administrator" is how you elevate though UAC, yes. And elevating though UAC will probably change the working directory, which makes your relative path useless.

How To Ask Questions The Smart Way


Report •

Related Solutions

#4
September 10, 2011 at 07:49:59
ohh ok. So how do I get it to work correctly?

a cd function?


Report •

#5
September 10, 2011 at 08:02:29
Replace:
".\DATA\upmbam\ignore.dat"

With:
"%~d0\DATA\upmbam\ignore.dat"

How To Ask Questions The Smart Way


Report •

#6
September 10, 2011 at 12:27:59
Thank you very much for your help

Report •

Ask Question