Running Batch File as Administrator vs. Running as User
But Windows behaves differently when the batch script is running one way vs. another way. In this thread, we point out the subtle differences. Current Working Directory: When you run the batch file as a user, the working directory is where the batch file resides. But when you run the batch file as administrator, the current working directory is "%SystemDrive%\WINDOWS\system32". Because of this difference, when programming batch scripts, try not to rely on the current directory as the script location. Instead, determine the script location using batch variables. For example: set scriptDir=%~d0%~p0 Mel
Did your message disappear? Read the Forums FAQ. Add Comment
TrackBackTrackBack only accepted from WebSite-X Suite web sites. Do not submit TrackBacks from other sites.
No TrackBacks yet. TrackBack can be used to link this thread to your weblog, or link your weblog to this thread. In addition, TrackBack can be used as a form of remote commenting. Rather than posting the comment directly on this thread, you can posts it on your own weblog. Then have your weblog sends a TrackBack ping to the TrackBack URL, so that your post would show up here. Messages, files, and images copyright by respective owners. |
Products
|
Services
87 Users Online
![]() |
Copyright © 1996 - 2025. All Rights Reserved. |