Why does 'Run as administrator' change (sometimes) batch file's current directory?
I have a batch file that is in the same directory as the file I want to xcopy . But for some reason the file is not being found. I thought that current directory was always where the batch file was located. I run batch file as administrator. This occurs on a Windows 7 64-bit desktop computer. Batch file: @ECHO OFF XCOPY /y "File1.txt" "File2.txt" PAUSE Error: File not found - File1.txt 0 File(s) copied Which directory is current working directory on starting a batch file with context menu item Run as administrator depends on User Account Control (UAC) setting for the current user. This can be