a better command line on Windows  | Moderator | | Join Date: Sep 2006 Location: Minden, Nevada, USA
Posts: 6,403
| |
If you like me and think the ms cmd.exe really bites, check out consol2 here.
|  | Familiar Sight | | Join Date: Nov 2006
Posts: 145
| | | re: a better command line on Windows Quote:
Originally Posted by bartonc If you like me and think the ms cmd.exe really bites, check out consol2 here. Have you seen the new 'monad' shell that was at one point supposed to ship with Vista?
It actually looks like M$ may have finally tapped their talent, though the commands are somewhat verbose (you can use aliases though)...
|  | Moderator | | Join Date: Sep 2006 Location: Minden, Nevada, USA
Posts: 6,403
| | | re: a better command line on Windows Quote:
Originally Posted by Colloid Snake Have you seen the new 'monad' shell that was at one point supposed to ship with Vista?
It actually looks like M$ may have finally tapped their talent, though the commands are somewhat verbose (you can use aliases though)... Actually, I copied this post from the python forum. It was aimed at those who call scripts from the command line often. I still believe that sys admin should be done using GUI tools. So, as people create tools and publish them, I add them to my toolbox (like WEVE for setting environment variables using tree widgets).
|  | Moderator | | Join Date: Sep 2006 Location: Los Angeles, CA
Posts: 596
| | | re: a better command line on Windows
Yeah this is cool, nice link barton, I have seen the software before, the one I particularly liked was integrated into every explorer window and would show you the entire tree of where you were looking. I used it when I was working at the Boys and Girls Club of America but people would always think that I am hacking and so I got rid of it.
Cheers.
|  | Administrator | | Join Date: Oct 2006 Location: London - UK
Posts: 16,173
| | | re: a better command line on Windows
I actually think MS have actually provided a very powerful command line system.
GUI is fine for standard usage, but command line is best for scripting and scheduling.
I often want to save myself the bother of repeating tasks laboriously, so I use CMD.Exe to create automation.
|  | Moderator | | Join Date: Sep 2006 Location: Minden, Nevada, USA
Posts: 6,403
| | | re: a better command line on Windows Quote:
Originally Posted by NeoPa I actually think MS have actually provided a very powerful command line system.
GUI is fine for standard usage, but command line is best for scripting and scheduling.
I often want to save myself the bother of repeating tasks laboriously, so I use CMD.Exe to create automation. I've got two partitions on my system. I've tried to
>> cd d:\
but nothing happened. With a nicer interface, I've been able to set the working directory without typing in the name_which_could_be_very_long_and_cumbersone_to_ty pe. It just seems so archaic to expect a mere mortal to type in directory names_which_could_be_very_long_and_cumbersone_to_t ype.
|  | Administrator | | Join Date: Oct 2006 Location: London - UK
Posts: 16,173
| | | re: a better command line on Windows
But that's not its strength (Although I never do anyway. If long and cumbersome (created by someone else!) then I copy/paste from Win Explorer).
I use it for running command scripts mainly. Preparing scripts and automating things is where it is strong. It's never been particularly intuitive, I'll grant you, but - especially since the advent of the Cmd.Exe version - it's quite flexible and powerful.
Actually, forget about especially since ... ONLY since.
|  | Moderator | | Join Date: Sep 2006 Location: Minden, Nevada, USA
Posts: 6,403
| | | re: a better command line on Windows Quote:
Originally Posted by NeoPa But that's not its strength (Although I never do anyway. If long and cumbersome (created by someone else!) then I copy/paste from Win Explorer).
I use it for running command scripts mainly. Preparing scripts and automating things is where it is strong. It's never been particularly intuitive, I'll grant you, but - especially since the advent of the Cmd.Exe version - it's quite flexible and powerful.
Actually, forget about especially since ... ONLY since. What about
> cd d:\
Trying to access another partition on the drive. It looks just like another drive to the rest of the world; why not cmd?
|  | Administrator | | Join Date: Oct 2006 Location: London - UK
Posts: 16,173
| | | re: a better command line on Windows Quote:
Originally Posted by bartonc What about
> cd d:\
Trying to access another partition on the drive. It looks just like another drive to the rest of the world; why not cmd? What problems are you having with cd d:\ ?
I don't have any.
|  | Moderator | | Join Date: Sep 2006 Location: Minden, Nevada, USA
Posts: 6,403
| | | re: a better command line on Windows Quote:
Originally Posted by NeoPa What problems are you having with cd d:\ ?
I don't have any. cmd.exe starts in
C:\Documents and Settings\Barton>
So I try this:
C:\Documents and Settings\Barton>cd d:\
C:\Documents and Settings\Barton>cd c:\
C:\>
It seems logical to me that I should be able to cd to the d partition. What's up with that?
|  | Administrator | | Join Date: Oct 2006 Location: London - UK
Posts: 16,173
| | | re: a better command line on Windows
I'm sorry. I was a little inaccurate with my earlier comments.
cd d:\ will actually change the current directory FOR THE D: DRIVE, but without changing the current drive to D:.
To do the latter as well you need to use
cd /d d:\
This is because each drive letter remembers its own 'current directory' and you need the facility for changing this without necessarily changing to that drive.
Why the default is NOT to change the drive when setting the current directory I'm not sure. Probably historical.
|  | Administrator | | Join Date: Oct 2006 Location: London - UK
Posts: 16,173
| | | re: a better command line on Windows
A little addendum to my last :-
Originally (DOS) you would say
as two separate commands, which still works, of course.
|  | Member | | Join Date: Oct 2006
Posts: 98
| | | re: a better command line on Windows
If you look at DOS manuals, CD is for rerouting to different folders, not drives
Simply type D: note** DO NOT TYPE D:\ IT DOESN'T WORK
|  | Moderator | | Join Date: Sep 2006 Location: Minden, Nevada, USA
Posts: 6,403
| | | re: a better command line on Windows Quote:
Originally Posted by TheMadMidget If you look at DOS manuals, CD is for rerouting to different folders, not drives
Simply type D: note** DO NOT TYPE D:\ IT DOESN'T WORK I haven't seen a DOS manual in about 20 years. And I didn't read that one. lol,
Barton
|  | Administrator | | Join Date: Oct 2006 Location: London - UK
Posts: 16,173
| | | re: a better command line on Windows Quote:
Originally Posted by TheMadMidget If you look at DOS manuals, CD is for rerouting to different folders, not drives
Simply type D: note** DO NOT TYPE D:\ IT DOESN'T WORK TheMadMidget,
That's not quite right any more. It used to be the case, but no longer (exactly).
See my previous post for fuller explanation.
|  | Member | | Join Date: Oct 2006
Posts: 98
| | | re: a better command line on Windows
I understand that, but you described basically the same thing without stating directly that CD shouldn't be used for cross drive reading. It's just another example of microsoft noobing stuff and I figure everyone might want to know the proper method, regardless of version of DOS.
|  | Administrator | | Join Date: Oct 2006 Location: London - UK
Posts: 16,173
| | | re: a better command line on Windows
Did you read post #11?
Don't get me wrong, I think it's good that you're contributing, but I thought I'd covered all the bases pretty thoroughly.
|  | Member | | Join Date: Oct 2006
Posts: 98
| | | re: a better command line on Windows
Aight (need 10 chars to post)
|  | Administrator | | Join Date: Oct 2006 Location: London - UK
Posts: 16,173
| | | re: a better command line on Windows Quote:
Originally Posted by TheMadMidget Aight (need 10 chars to post) Does that have some special meaning? Aight?
I'm afraid I don't follow.
| | Moderator | | Join Date: Oct 2006 Location: Australia
Posts: 7,748
| | | re: a better command line on Windows Quote:
Originally Posted by NeoPa Does that have some special meaning? Aight?
I'm afraid I don't follow. Sounds like Ebonic for Alright.
| | Moderator | | Join Date: Oct 2006 Location: Australia
Posts: 7,748
| | | re: a better command line on Windows Quote:
Originally Posted by NeoPa Did you read post #11? ... I can see TheMadMidget's point. Until I went and checked just now, I had no idea the /D option existed. I must remember that one.
| | Moderator | | Join Date: Oct 2006 Location: Australia
Posts: 7,748
| | | re: a better command line on Windows
By the way, there are also things which are much easier to do from the command line than from Explorer, such as a batch rename.
|  | Moderator | | Join Date: Sep 2006 Location: Minden, Nevada, USA
Posts: 6,403
| | | re: a better command line on Windows Quote:
Originally Posted by NeoPa I'm sorry. I was a little inaccurate with my earlier comments.
cd d:\ will actually change the current directory FOR THE D: DRIVE, but without changing the current drive to D:.
To do the latter as well you need to use
cd /d d:\
This is because each drive letter remembers its own 'current directory' and you need the facility for changing this without necessarily changing to that drive.
Why the default is NOT to change the drive when setting the current directory I'm not sure. Probably historical. Of course, I didn't start this thread to learn DOS, but thanks for that. I started this to open up other posibilities for others. Using Console2 the cd d: thing works just as I'd expect.
| | Moderator | | Join Date: Oct 2006 Location: Australia
Posts: 7,748
| | | re: a better command line on Windows Quote:
Originally Posted by bartonc Of course, I didn't start this thread to learn DOS, but thanks for that. I started this to open up other posibilities for others. Using Console2 the cd d: thing works just as I'd expect. What, it changes the current directory on D: and also sets D: as the current drive?
(I don't find that intuitive at all, but that's probably because I learned DOS so long ago.)
|  | Moderator | | Join Date: Sep 2006 Location: Minden, Nevada, USA
Posts: 6,403
| | | re: a better command line on Windows Quote:
Originally Posted by Killer42 What, it changes the current directory on D: and also sets D: as the current drive?
(I don't find that intuitive at all, but that's probably because I learned DOS so long ago.) Nope. I lied. I just tried it (it works like DOS). The thing it does do is start in the directory (and has tabs so there can be many) that I want it to.
|  | Administrator | | Join Date: Oct 2006 Location: London - UK
Posts: 16,173
| | | re: a better command line on Windows Quote:
Originally Posted by Killer42 I can see TheMadMidget's point. Until I went and checked just now, I had no idea the /D option existed. I must remember that one. I could understand that if I hadn't already posted an answer to that point.
|  | Administrator | | Join Date: Oct 2006 Location: London - UK
Posts: 16,173
| | | re: a better command line on Windows Quote:
Originally Posted by bartonc Of course, I didn't start this thread to learn DOS, but thanks for that. I started this to open up other posibilities for others. Using Console2 the cd d: thing works just as I'd expect. Not open to argument then Barton?
I'm afraid the point you made was incorrect - you were simply misusing it. You really shouldn't complain, if you bring up a point, when someone corrects your inaccuracy. If you don't want the truth - don't ask the question.
I'm happy to bash Microsoft when they get it wrong - pretending something is wrong simply because it is Microsoft is not right.
I'm assuming of course, that your Quote:
Originally Posted by bartonc Of course, I didn't start this thread to learn DOS, but thanks for that. Was being ironic.
If that is not the case then accept my apology for the tone of this response.
| | Moderator | | Join Date: Oct 2006 Location: Australia
Posts: 7,748
| | | re: a better command line on Windows Quote:
Originally Posted by NeoPa I could understand that if I hadn't already posted an answer to that point. Yeah, that's sort of what I was referring to - the /D that you pointed out. I hadn't known about it until then, so I went and looked it up.
I can't remember what (or whether) I was thinking when I posted #21.
|  | Administrator | | Join Date: Oct 2006 Location: London - UK
Posts: 16,173
| | | re: a better command line on Windows Quote:
Originally Posted by Killer42 I can't remember what (or whether) I was thinking when I posted. You and me both Killer!
I think a more public apology is called for here (for my previous post).
Barton has never said anything to deserve that tirade - please put it down to catching me at a bad time :(
| | Moderator | | Join Date: Oct 2006 Location: Australia
Posts: 7,748
| | | re: a better command line on Windows Quote:
Originally Posted by NeoPa You and me both Killer!
I think a more public apology is called for here (for my previous post).
Barton has never said anything to deserve that tirade - please put it down to catching me at a bad time :( As I read it I was thinking "who got up on the wrong side of the bed this morning?" :)
I guess we all have our good and bad days.
|  | Moderator | | Join Date: Sep 2006 Location: Minden, Nevada, USA
Posts: 6,403
| | | re: a better command line on Windows Quote:
Originally Posted by Killer42 As I read it I was thinking "who got up on the wrong side of the bed this morning?" :)
I guess we all have our good and bad days. The funny thing is that I smile at this type of back-and-forth and don't take it at all personlly. So there is absolutely no appology necessary. I really like the console that I am using (though I don't use it often) and simply wanted others to know that there were options. (Plus, at the time, I really needed to get my post count up) <snicker>.
| | Moderator | | Join Date: Oct 2006 Location: Australia
Posts: 7,748
| | | re: a better command line on Windows Quote:
Originally Posted by bartonc The funny thing is that I smile at this type of back-and-forth and don't take it at all personlly. So there is absolutely no appology necessary. I really like the console that I am using (though I don't use it often) and simply wanted others to know that there were options. (Plus, at the time, I really needed to get my post count up) <snicker>. Yeah, it's really a shame when some people do take these things very personally, and seriously. Brings down the whole tone of the place.
That's why so many discussion boards descend into never-ending flame wars, I'd say. It's like a family feud, in a way. After a while nobody remembers what triggered it - just gotta get revenge on those <bleep>s for taking revenge on me for my revenge attack... and so on.
Quite sad, really. But of course we're all more intelligent than that. :)
|  | Administrator | | Join Date: Oct 2006 Location: London - UK
Posts: 16,173
| | | re: a better command line on Windows Quote:
Originally Posted by Killer42 Quite sad, really. But of course we're all more intelligent than that. :) I wish :embarrassed:
|  | Moderator | | Join Date: Sep 2006 Location: Minden, Nevada, USA
Posts: 6,403
| | | re: a better command line on Windows Quote:
Originally Posted by NeoPa I wish :embarrassed: I'm touched at your concern. Thanks buddy.
|  | Moderator | | Join Date: Sep 2006 Location: Minden, Nevada, USA
Posts: 6,403
| | | re: a better command line on Windows Quote:
Originally Posted by bartonc Nope. I lied. I just tried it (it works like DOS). The thing it does do is start in the directory (and has tabs so there can be many) that I want it to. I've discovered a solution to this: Create a shortcut to cmd.exe and modify the "start in" property.
Why didn't anybody tell me about this?
| | Moderator | | Join Date: Oct 2006 Location: Australia
Posts: 7,748
| | | re: a better command line on Windows Quote:
Originally Posted by bartonc I've discovered a solution to this: Create a shortcut to cmd.exe and modify the "start in" property.
Why didn't anybody tell me about this? Um... you didn't ask? :)
I have used this technique, but its usefulness is somewhat limited by the fact that you need to specifically create a shortcut for whichever folder you're interested in. You'd be better off looking up the registry mod which allows you to right-click a folder and "start DOS here".
|  | Moderator | | Join Date: Sep 2006 Location: Minden, Nevada, USA
Posts: 6,403
| | | re: a better command line on Windows Quote:
Originally Posted by Killer42 Um... you didn't ask? :)
I have used this technique, but its usefulness is somewhat limited by the fact that you need to specifically create a shortcut for whichever folder you're interested in. You'd be better off looking up the registry mod which allows you to right-click a folder and "start DOS here". Cool, Killer. I've got a book full of registry mods. Could be in there. Generally, though, I'm only working on one big project at a time so the icon thing works pretty well. Thanks for the tip.
|  | Administrator | | Join Date: Oct 2006 Location: London - UK
Posts: 16,173
| | | re: a better command line on Windows
Killer beat me to the no-one asked response ;)
Your answer seems to be right though Barton - for your situation. We all have to remember sometimes, that requirements vary so much for different situations that brilliant answers are sometimes inappropriate for someone else's situation - or even just overkill.
It's nice to know there are so many solutions out there though, and even better IMHO, that we have so many experts that know about them in TheScripts :)
|  | Moderator | | Join Date: Sep 2006 Location: Minden, Nevada, USA
Posts: 6,403
| | | re: a better command line on Windows Quote:
Originally Posted by NeoPa It's nice to know there are so many solutions out there though, and even better IMHO, that we have so many experts that know about them in TheScripts :) Both SO true. TSDN is an awesome resource, even for the "experts" themselves!
|  | Moderator | | Join Date: Sep 2006 Location: Minden, Nevada, USA
Posts: 6,403
| | | re: a better command line on Windows Quote:
Originally Posted by Killer42 You'd be better off looking up the registry mod which allows you to right-click a folder and "start DOS here". . Start > Run > regedit
. open HKEY_LOCAL_MACHINE/Software/Classes/Folder/Shell
. right-click on Shell > New > Key
. name it Command Prompt (or anything you think is descriptive for yourself)
. in the right frame, for the default value, of the Command Prompt key you jsut made, enter whatever text you want to appear in the context menu (e.g. Open Command Prompt Here -or- Commaaaaaannnd!)
. back in the left frame, right-click Command Prompt (or whatever you called it) > New > Key
. name this sub-key command [it must be named command to work]
. in the right frame of command, set the default value to Cmd.exe /k pushd %L
the last step will launch Cmd.exe; the /k switch will keep it open; the pushd command stores the name of the current directory, and %L uses that name to start the command prompt at it. this method will work instantly, only on folders, NOT files
|  | Moderator | | Join Date: Sep 2006 Location: Los Angeles, CA
Posts: 596
| | | re: a better command line on Windows
Very interesting thanks for sharing, I always get frustrated when running a command from run and having it pop up for a second and then disappear.
Regards, Cyberdyne
|  | Administrator | | Join Date: Oct 2006 Location: London - UK
Posts: 16,173
| | | re: a better command line on Windows
I use a Command Prompt shortcut (Always to Cmd.Exe) saved in my Quick Launch Toolbar.
| | Moderator | | Join Date: Oct 2006 Location: Australia
Posts: 7,748
| | | re: a better command line on Windows Quote:
Originally Posted by NeoPa I use a Command Prompt shortcut (Always to Cmd.Exe) saved in my Quick Launch Toolbar. I just hit the (standard) shortcut key to invoke "Run" then type "CMD" and [Enter]. I find it's quicker than going to the mouse, and not worth cluttering up the quick-launch bar for. But it's annoying how it always starts in the same place.
I'll probably set up the "DOS here" option, when I get a minute.
|  | Moderator | | Join Date: Sep 2006 Location: Los Angeles, CA
Posts: 596
| | | re: a better command line on Windows
Yeah for sure, I use the windows run command as well, I wish windows had a combination of keys to launch cmd automatically. I have done it with one of my logitech keyboards that lets me assign special keys, but I am saying more like hitting windows d or something.
| | Moderator | | Join Date: Oct 2006 Location: Australia
Posts: 7,748
| | | re: a better command line on Windows Quote:
Originally Posted by Cyberdyne Yeah for sure, I use the windows run command as well, I wish windows had a combination of keys to launch cmd automatically. I have done it with one of my logitech keyboards that lets me assign special keys, but I am saying more like hitting windows d or something. Well, you could certainly set up a shortcut and assign it Ctl-Alt-D or something.
|  | Moderator | | Join Date: Jan 2007 Location: Maine, USA
Posts: 2,904
| | | re: a better command line on Windows
You should all just get Cygwin, and use bash.
|  | Moderator | | Join Date: Sep 2006 Location: Los Angeles, CA
Posts: 596
| | | re: a better command line on Windows
Good Idea that's what I just did and its quicker then running through start>run>type in cmd and hit Enter
so now I have a shortcut on my desktop referencing cmd.exe with a key combo CTRL + ALT + D =D)
|  | Moderator | | Join Date: Sep 2006 Location: Minden, Nevada, USA
Posts: 6,403
| | | re: a better command line on Windows Quote:
Originally Posted by bartonc If you like me and think the ms cmd.exe really bites (or worse, cygwin), check out consol2 here. Just bringing this discussion back on track.
|  | Moderator | | Join Date: Sep 2006 Location: Los Angeles, CA
Posts: 596
| | | re: a better command line on Windows
Yeah I installed it and its pretty cool but cmd is just classic, I can always depend on it because it comes preinstalled on all windows systems.
|  | Administrator | | Join Date: Oct 2006 Location: London - UK
Posts: 16,173
| | | re: a better command line on Windows
I'm with you on that one Cyber.
It also has a lot of very powerful capabilities which most people aren't aware of as they were added in for NT (Way back when). I guess we won't be making many converts in here though ;)
|  | | Similar Microsoft Windows / Vista / XP / ME / 95 & 98 bytes | | | Forums
Visit our community forums for general discussions and latest on Bytes
/bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 229,155 network members.
|