Simple method to run a batch as Administrator using javascript
问题 I want to derive a simple reliable method to auto elevate a running batch without using extra VBS files or elevated shortcuts, proposed in other threads. Calling the UAC dialog from the batch via javascript ensures the short simple code. The script below auto elevates a user to Admin rights correctly, when Yes is chosen in the dialog, but the error dialog popups (outside of Cmd window) " Windows cannot find 'test.bat '". Can it be since the path-to-file includes spaces? How to fix the code or