nesdev.com
http://forums.nesdev.com/

.bat/.cmd/cmd.exe tips to speed up using windows.
http://forums.nesdev.com/viewtopic.php?f=5&t=16408
Page 2 of 2

Author:  Oziphantom [ Fri Aug 25, 2017 3:27 am ]
Post subject:  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.

Author:  FrankenGraphics [ Fri Aug 25, 2017 4:34 am ]
Post subject:  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.


Quote:
something more complex than Batch

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.

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.

Author:  Oziphantom [ Fri Aug 25, 2017 4:40 am ]
Post subject:  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..

Author:  FrankenGraphics [ Fri Aug 25, 2017 5:31 am ]
Post subject:  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.

Author:  Oziphantom [ Fri Aug 25, 2017 5:55 am ]
Post subject:  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

Code:
Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\Chrono>


So now at the command prompt I type Em[tab] and then it will autofill it to Emulation thus it shows
Code:
Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\Chrono>Emulation


I mean it won't in Win95 or Win98

Author:  tepples [ Fri Aug 25, 2017 7:05 am ]
Post subject:  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.

Author:  Dwedit [ Fri Aug 25, 2017 7:18 am ]
Post subject:  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.

Author:  TmEE [ Fri Aug 25, 2017 8:12 am ]
Post subject:  Re: .bat/.cmd/cmd.exe tips to speed up using windows.

There is CMD.EXE floating around that works in 9x.

http://www.tmeeco.eu/9X4EVER/GOODIES/CMD.EXE

Author:  FrankenGraphics [ Fri Aug 25, 2017 8:21 am ]
Post subject:  Re: .bat/.cmd/cmd.exe tips to speed up using windows.

oziphantom wrote:
[...] taling about the same thing

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.

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.

Quote:
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 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)

Author:  Oziphantom [ Fri Aug 25, 2017 8:29 am ]
Post subject:  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

Page 2 of 2 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/