I'm writing a .bat script where I need to copy a file to System32. I change to the folder then attempt to copy the file from a storage folder to the System32 folder.
cd C:\Windows\System32
copy %~dp0file.txt file.txt
I get an error Access Denied, 0 files copied
.
I see why this is a problem, because if I try to copy a file to System32 using the non-programmatic GUI interface, I get a prompt asking me to confirm. So with the script, how do I bypass this Windows permissions or set it correctly, or some other solution.
Edit: The hint I got from the answer below is that it's possible to trigger Windows to show its GUI prompt for the user to give permissions. This idea will do. Hopefully someone knows exactly how to do this.