Jump to content

Quick CMD prompt trick to start in your own folder


NoelC

Recommended Posts

I keep UAC off, so every CMD prompt wants to open in C:\Windows\System32 - arguably the WORST place possible to do things like copy files, drop temporary files, etc.

 

With a tiny bit of command line magic you can get an elevated CMD prompt to start in whatever folder you want.  I personally prefer:  C:\TEMP

 

Set your shortcut up with this command line:

C:\Windows\System32\cmd.exe /k cd \temp&ver

It executes a cd command to send it to the folder you want (it could even be a cd /d command if you'd like to be on a drive other than the system drive), then puts the familiar version string up.  I suppose you could mock up the Copyright message normally shown as well, but I have no love of seeing that, so...

 

CMDPrompt.png

 

-Noel

Link to comment
Share on other sites


Well, with all due respect :) it is not like it seems particularly useful (to me).

 

A "Command Prompt here" solution is IMHO much more useful in Windows.

I use this since the dawn of time (unlike most similar solutions it opens the command prompt where you right click, i.e. you do not need to select the parent directory):

http://www.roggel.com/NGNeer/BackgroundCMD/index.shtml

 

This (more recent) should also do on systems that have elevation/UAC:

http://code.kliu.org/cmdopen/

 

If you like your "open on C:\temp" solution, maybe it would be better :unsure: if you used a PUSHD command (so that by running POPD you could go back - if needed - to C:\Windows\System32\cmd.exe):

http://ss64.com/nt/pushd.html

 

jaclaz

Link to comment
Share on other sites

Didn't work for me Noel

And I'm not fond of adding extra programs to do things should come easy.

 

I was wanting right click on any folder or background/desktop to get Admin cmd prompt

Found it here, simple reg tweak works on Win 10 also

Open command window here as Administrator

Edited by maxXPsoft
Link to comment
Share on other sites

It's not a big deal in itself, except that it works around a limitation that Microsoft put in - that an elevated command prompt won't open in the folder you program in the shortcut. 

 

Up through Win 8.1 with UAC disabled one could just set the "Start In" folder to where you want the CMD prompt to start, and voila, it starts there.

 

We all work in different ways.  I happen to like to work in my TEMP folder so I can drop files (e.g., from filter commands and such) so that I can do other things with them.

 

I haven't found much use for "Start CMD prompt here" type functionality, but I do integrate a lot of other things (like "Send to Clipboard As Name", specifically) into Explorer, so maybe that's influenced the way I work.

 

-Noel

 

 

P.S., and no, I don't want to return to C:\Windows\System32 under any conditions.

Edited by NoelC
Link to comment
Share on other sites

Didn't work for me Noel

 

It didn't work for you?

 

You mean you pasted the command line I showed you above into a shortcut and it didn't actually CD to the folder you specified?  You do have that folder already in existence, right?

 

-Noel

Link to comment
Share on other sites

 

Didn't work for me Noel

you do have that folder already in existence, right?

 

-Noel

 

 

oops no I had it but running Uncleaner may have deleted it. Create but still didn't work though. Opened Temp but not Admin

 

I prefer the Admin cmd prompt in whatever folder I'm in so I can drop to it and test switches and such

Link to comment
Share on other sites

Just to be clear, if you're using UAC, you're expected to use the properties of the shortcut to run CMD as administrator.  That's assumed here, and is apparently what makes CMD in Win 10 ignore the default directory you've set in the Start in field.

 

CMDShortcut.png

 

-Noel

Edited by NoelC
Link to comment
Share on other sites

Just to be clear, if you're using UAC

LOL you think I use that UAC. One of the most annoying things you disable first on any setup for advanced users of course.

I see a need for it, for the unknowing, the 99.999%

 

Nope gotta be something else, only diff is possibly I'm still on LTSB

I've captured registry for each Pro, LTSB as soon as I hit desktop for my comparison's but don't see anything yet would affect this.

Cmd prompt has some things apply if you look at the cmd /?

But Mikeysoft explanations are not the best and they even get the upper/lower case crap wrong. 21 years fighting that mess

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...