Popular Post 6Foot2 Posted July 17, 2015 Popular Post Posted July 17, 2015 http://i.snag.gy/fxe2t.jpg [Didn't know this until today ] Also: Pressing F8 will cycle through the command history line by line. 17
Arthur Posted July 17, 2015 Posted July 17, 2015 PowerShell has the same feature. http://vgy.me/Ck2OYp.png 4
CAM Posted July 17, 2015 Posted July 17, 2015 I knew of this feature since college a decade ago but forgot what the key was! Thanks!
sparkeh Posted July 17, 2015 Posted July 17, 2015 Hmm didn't know that! All these years I have using the up and down arrow to cycle through the history. 2
BKGarry Posted July 17, 2015 Posted July 17, 2015 Wow, that is awesome, no longer will I be scrolling through again and again and again
halbaradkenafin Posted July 17, 2015 Posted July 17, 2015 PowerShell has the same feature. http://vgy.me/Ck2OYp.png I prefer to use Get-history: Get-History | Out-GridView 3
mac_shinobi Posted July 17, 2015 Posted July 17, 2015 Hmm didn't know that! All these years I have using the up and down arrow to cycle through the history. Same here - I normally just use the up / down arrow keys and cycle through them that way Never knew about F7 / F8 etc - I'll Be Dammed !! Thanks for this post @DaveP
CAM Posted July 17, 2015 Posted July 17, 2015 I prefer to use Get-history: Get-History | Out-GridView That grid view command is really handy! ls | ogv Wonder if I can combine this with the SQL and XML functions....
halbaradkenafin Posted July 17, 2015 Posted July 17, 2015 That grid view command is really handy! ls | ogv Wonder if I can combine this with the SQL and XML functions.... As long as you're function is using something (Write-output is my go to cmdlet) to return an object containing that data then it should work fine.
Oaktech Posted July 17, 2015 Posted July 17, 2015 Why would you even need command history, surely we are all crafting our commands carefully and only entering what we need the one time, and if we need something repetitive, well its on the up key! 1
network41 Posted July 17, 2015 Posted July 17, 2015 (edited) Doesn't work for me Sorry , it does just me being dumb Edited July 17, 2015 by network41 Stupidity
6Foot2 Posted July 17, 2015 Author Posted July 17, 2015 Doesn't work for me How odd! Any error messages/screenshots?
howartp Posted July 17, 2015 Posted July 17, 2015 Well I never... Nope, I've never come across this and I script/code regularly with Dos and recently PowerShell! Thanks!
Jamman960 Posted July 18, 2015 Posted July 18, 2015 Thanks, have always used up, down and right /tab but didn't know about f7/8
MrEprise Posted July 18, 2015 Posted July 18, 2015 (edited) I've known about this for a little while (inadvertently, when an object fell on my keyboard) and while I do find it useful, I still find myself using the up/down arrow keys and F3 often. Fun fact: This functionality has been available as far back as MS-DOS 5.0 which included the first release of DOSKEY.EXE. However, it's not as nice to use as F7 only lists previous commands and doesn't let you select them. Somehow you're supposed to use doskey to execute those but I haven't yet worked out how. EDIT: Apparently it's F9, which asks for a line number from the F7 list which when inputted then displays that previous command. It's actually worth looking up DOSKEY on Wikipedia as this gives you a whole host of different commands and keys which also apply to the current command prompt. Edited July 18, 2015 by MrEprise
Popular Post 6Foot2 Posted July 22, 2015 Author Popular Post Posted July 22, 2015 A couple more [i only found out about them this evening] When using Windows Explorer navigate to a folder and then in the address bar type "CMD" [without the quotes] and press return to have the Command Prompt to open in the same folder: http://i.gyazo.com/9732e90e7b19e84f9bfb079e9d3268f7.png Also: At the Command Prompt type "Start." [without the quotes] and press return to have Windows Explorer start viewing the folder that the Command Prompt was sitting at when the command was typed: http://i.gyazo.com/3e04e23cccfb9fed8c4aecfe58a37671.png 5
Arthur Posted July 22, 2015 Posted July 22, 2015 There are a couple of alternative ways to accomplish the same thing. When using Windows Explorer navigate to a folder and then in the address bar type "CMD" [without the quotes] and press return to have the Command Prompt to open in the same folder: Hold down Shift in any Explorer window to see an additional context menu item called "Open command window here". http://vgy.me/y5NXWr.png At the Command Prompt type "Start." [without the quotes] and press return to have Windows Explorer start viewing the folder that the Command Prompt was sitting at when the command was typed: Although it's a few characters longer you can also type "Explorer ." http://vgy.me/7kbvot.png
Arthur Posted July 22, 2015 Posted July 22, 2015 For those that prefer PowerShell to the Command Prompt the script posted below might be useful. Run it once to add an extra item to your context menu called "Open Windows PowerShell here". http://vgy.me/gKIoZp.png # Source: http://www.powershellmagazine.com/2013/06/25/pstip-how-to-start-an-elevated-powershell-from-windows-explorer/ $menu = 'Open Windows PowerShell here' $command = "$PSHOME\powershell.exe -NoExit -NoProfile -Command ""Set-Location '%V'""" 'directory', 'directory\background', 'drive' | ForEach-Object { New-Item -Path "Registry::HKEY_CLASSES_ROOT\$_\shell" -Name runas\command -Force | Set-ItemProperty -Name '(default)' -Value $command -PassThru | Set-ItemProperty -Path {$_.PSParentPath} -Name '(default)' -Value $menu -PassThru | Set-ItemProperty -Name HasLUAShield -Value '' } 1
6Foot2 Posted July 23, 2015 Author Posted July 23, 2015 Another: Add " | clip" [without the quotes] to the end of many DOS/Powershell commands to copy the output directly to the clipboard: http://i.snag.gy/AkLDb.jpg 3
6Foot2 Posted July 24, 2015 Author Posted July 24, 2015 (edited) When using Windows Explorer drag a folder over to an open Command Prompt box and it will copy the path of the folder into the box: http://i.snag.gy/1mZaa.jpg Re: Yesterday's 'Clip Tip' You can read the content of a file onto the clipboard: http://i.snag.gy/S8fE2.jpg Edit: If you were to add " && notepad" [without the quotes] it would start notepad ready for you to paste the information on the clipboard: http://i.snag.gy/2v80D.jpg Edited July 24, 2015 by 6Foot2 Add detail to the post and correct a typo.
6Foot2 Posted March 13, 2017 Author Posted March 13, 2017 doskey /history [ATTACH=CONFIG]42117[/ATTACH] Save doskey command history to a text file: doskey /history > C:\Users\name\Desktop\commands.txt [ATTACH=CONFIG]42118[/ATTACH] Result: [ATTACH=CONFIG]42119[/ATTACH]
6Foot2 Posted March 13, 2017 Author Posted March 13, 2017 doskey /history Save doskey command history to a text file: doskey /history > C:\Users\name\Desktop\commands.txt Result:
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now