Click here to Skip to main content
12,448,164 members (54,196 online)
Click here to Skip to main content
Add your own
alternative version

Stats

4K views
3 bookmarked
Posted

Batch file caveat when running as administrator

, 1 Mar 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
First command of the file should be:PUSHD directory_you_want_to_be_inThat solves it always. No testing for anything. No need to error out, because your expected file's gonna be in the expected directory.
First command of the file should be:

PUSHD directory_you_want_to_be_in

That solves it always. No testing for anything. No need to error out, because your expected file's gonna be in the expected directory.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Br.Bill
United States United States
No Biography provided

You may also be interested in...

Pro
Pro

Comments and Discussions

 
GeneralPass the directory you're going into as a parameter to the s... Pin
Br.Bill1-Mar-11 8:50
memberBr.Bill1-Mar-11 8:50 
GeneralRe: I think the one above is better (I was talking about running... Pin
Indivara1-Mar-11 20:03
subeditorIndivara1-Mar-11 20:03 
GeneralBut what if you don't know which directory you want to be in... Pin
Indivara1-Mar-11 0:51
subeditorIndivara1-Mar-11 0:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160811.3 | Last Updated 1 Mar 2011
Article Copyright 2011 by Br.Bill
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid