In Windows Vista, Windows 7 or Windows 8 with UAC turned on, and you run the batch file with %CD% to get current directory, it actually points to C:\windows\system32. To solve this, set the following code at the beginning of your batch file.
@setlocal enableextensions
@cd /d "%~dp0"
It will change the directory or file path back to your current folder/path.
No comments:
Post a Comment