.bat/.cmd/cmd.exe tips to speed up using windows.
Moderator: Moderators
-
- Posts: 1565
- Joined: Tue Feb 07, 2017 2:03 am
Re: .bat/.cmd/cmd.exe tips to speed up using windows.
Personally I find Windows Explorer is the best thing about Windows and as soon as I get onto another OS I find it a slog fest to get anything done...
I trust you know about Right Click > New > New Text file. As in that will make a text file in the directory you are in and auto enter rename for it.
Also Win + R is handy, but these days Win + what ever you wanted before usually works just as good. Win + R - enter path will open WE at said path.
The New pin "quick access" has becomes my fav thing ever, I have all the folders I mainly use there, C64, GitHub etc.
I trust you also know that you can put anything you like into "Send To", I have transhexlation, allowing me to right click, send to and have it opened in a hex editor. But you should be able to add a link to the dropbox directory.
If you want something more complex than Batch, the WSHost is built in and lets you make VBA or JS based scripts that can be run.
I use Corsair K series keyboard as they have re-definable macro keys and I can switch "profiles" to change their function for my current need.
Also in WE F4 will take you to the address bar allowing you to type in a new address.
I trust you know about Right Click > New > New Text file. As in that will make a text file in the directory you are in and auto enter rename for it.
Also Win + R is handy, but these days Win + what ever you wanted before usually works just as good. Win + R - enter path will open WE at said path.
The New pin "quick access" has becomes my fav thing ever, I have all the folders I mainly use there, C64, GitHub etc.
I trust you also know that you can put anything you like into "Send To", I have transhexlation, allowing me to right click, send to and have it opened in a hex editor. But you should be able to add a link to the dropbox directory.
If you want something more complex than Batch, the WSHost is built in and lets you make VBA or JS based scripts that can be run.
I use Corsair K series keyboard as they have re-definable macro keys and I can switch "profiles" to change their function for my current need.
Also in WE F4 will take you to the address bar allowing you to type in a new address.
- FrankenGraphics
- Formerly WheelInventor
- Posts: 2064
- Joined: Thu Apr 14, 2016 2:55 am
- Location: Gothenburg, Sweden
- Contact:
Re: .bat/.cmd/cmd.exe tips to speed up using windows.
My gripe with win explorer is that it sometimes takes its sweet time (on my system). One or two greedy programs running (adobe) and you'll be forced to wait on occasions; sometimes for things like alt-tabbing to a particular explorer window or creating a new text file. cmd.exe on the other hand is almost always instantaneous, because it needs less. Otherwise the shell lets me do pretty much anything i want in daily use.
One thing easily overlooked is that cmd has completion, it's just that it's not autosuggesting.
Ctrl+D = folDer completion
Ctrl+F = File completion.
Not nearly as good as autocompletion, but it's there.
Admittedly, batch processing is loose and doesn't let you do things exactly the way you want.
For example, if you terminate a batch script (ctrl+c, enter), all your pushd:s are for nothing, i discovered. Your current directory won't be pulled back. That blows. There's sure to be workarounds, but so much of batch processing is workarounds.
One thing easily overlooked is that cmd has completion, it's just that it's not autosuggesting.
Ctrl+D = folDer completion
Ctrl+F = File completion.
Not nearly as good as autocompletion, but it's there.
It's also possible to run powershell commands from a bat or from cmd.exe directly. The former is probably great, but the latter is of limited use. you'd type "powershell" in front of every powershell command.something more complex than Batch
Admittedly, batch processing is loose and doesn't let you do things exactly the way you want.
For example, if you terminate a batch script (ctrl+c, enter), all your pushd:s are for nothing, i discovered. Your current directory won't be pulled back. That blows. There's sure to be workarounds, but so much of batch processing is workarounds.
-
- Posts: 1565
- Joined: Tue Feb 07, 2017 2:03 am
Re: .bat/.cmd/cmd.exe tips to speed up using windows.
Ctrl+D and F? I just tried them and Ctrl+F brings up Find and Ctrl+D makes ^D. TAB works however as you would expect it to in both CMD.exe and WE address bar.
Batch files tend to be self contained, and all the modifications they make are for the purpose of the batch file, i.e they leave the user state unmodified. I think there is an option to make their actions global, buts it been a while..
Batch files tend to be self contained, and all the modifications they make are for the purpose of the batch file, i.e they leave the user state unmodified. I think there is an option to make their actions global, buts it been a while..
- FrankenGraphics
- Formerly WheelInventor
- Posts: 2064
- Joined: Thu Apr 14, 2016 2:55 am
- Location: Gothenburg, Sweden
- Contact:
Re: .bat/.cmd/cmd.exe tips to speed up using windows.
oops, I forgot to write you need to cmd /f in order to activate these ctrl shortcuts. Probably the reason why they're so obscure. I've got this defaulted on my pinned cmd shortcut.
Note that tab will make a tab in the command line, so your only means afaik are ctrl-d and ctrl-f. Tapping multiple ctrl-d:s and f:s will step through any matching files, starting with the first match.
Note that tab will make a tab in the command line, so your only means afaik are ctrl-d and ctrl-f. Tapping multiple ctrl-d:s and f:s will step through any matching files, starting with the first match.
-
- Posts: 1565
- Joined: Tue Feb 07, 2017 2:03 am
Re: .bat/.cmd/cmd.exe tips to speed up using windows.
just so we are sure we are talking about the same thing..
cmd.exe
it shows
So now at the command prompt I type Em[tab] and then it will autofill it to Emulation thus it shows
I mean it won't in Win95 or Win98
cmd.exe
it shows
Code: Select all
Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.
C:\Users\Chrono>
Code: Select all
Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.
C:\Users\Chrono>Emulation
Re: .bat/.cmd/cmd.exe tips to speed up using windows.
But then Windows 98 is from the era when Command.com didn't mean adhesive hanging strips endorsed by MC Hammer.
Re: .bat/.cmd/cmd.exe tips to speed up using windows.
Would adding DosKey.exe to your autoexec.bat complete commands in Win98? I know it gave you Up arrow and command editing.
I also know that 4DOS had tab completion.
I also know that 4DOS had tab completion.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
- FrankenGraphics
- Formerly WheelInventor
- Posts: 2064
- Joined: Thu Apr 14, 2016 2:55 am
- Location: Gothenburg, Sweden
- Contact:
Re: .bat/.cmd/cmd.exe tips to speed up using windows.
Hm, i tested, and it seems the /f switch is the 'culprit' here. While it enables ctrl-f and ctrl-d, it is also enabling tabs/disabling completion through the tab key.oziphantom wrote:[...] taling about the same thing
So which you'd prefer comes down to if you prefer the pretty standard one-key press of tab, or the separation of completing files on one key, and directories on the other. Or if you need/find it useful to make tabs, i suppose.
Btw In win10, apparently, they finally introduced the usual clibboard shortcuts. I assume copying with ctrl-c would be suspended when running a bat.
I googled running directory pushing/pulling/changing code in a bat vs. batch termination by user, and it seems the common solution to this problem is letting that row or block of code run via a child instance like so: cmd /c (/c will close the child after execution is complete). This way, the %cd% of the parent will be intact even if the bat is prematurely cancelled. Even more interestingly, this technique lets the bat execute lines post-termination. (EDIT: while at it, it's probably best to make it cmd /c /d as to disregard autorun preferences local to the system)Batch files tend to be self contained, and all the modifications they make are for the purpose of the batch file, i.e they leave the user state unmodified.
Last edited by FrankenGraphics on Fri Aug 25, 2017 8:47 am, edited 1 time in total.
-
- Posts: 1565
- Joined: Tue Feb 07, 2017 2:03 am
Re: .bat/.cmd/cmd.exe tips to speed up using windows.
Ctrl + C = normal Control C
Ctrl + C when you have used the Mark option to select text = copy
Ctrl + V = paste at all times
Ctrl + C when you have used the Mark option to select text = copy
Ctrl + V = paste at all times