Reputation: 13
I have this batch file that when I run it normally(double click it) it runs just fine but when I right click and click "Run as Administrator" it says 'Specified file cannot be found"
I've searched on and about it for 2 days now and no luck. I just don't understand why it works when just normally double clicking it and not as administrator?
Shed some light please.
Upvotes: 0
Views: 178
Reputation: 70923
When double clicked, the default active directory is the same folder in where the batch file is stored.
When "Run as administrator" is used, the default active directory is probably not the same, usually %systemroot%\system32
.
Without seeing the code this is just an opinion, but if the code in the batch file uses relative paths it is possible that the files it try to use are not found.
Upvotes: 1