Command Prompt Secrets and Tricks in Windows
We're gonna be taking a look at the good old command prompt in Window And you may know this is a very useful tool but there are a lot of features that are pretty much unknown and dare.
Our secret features that make it even more useful now. This is going to be in Windows 10 particularly That what I'm using. But a lot of these are gonna carry over in previous versions as well I've got about 5 of these.
Probably says the path of the current folder. You're in like C And then either the user directory or maybe system 32 if you're running as an administrator, you can customize Any of that text to say whatever you want and you do this for example by typing in the prompt command so you prompt and then whatever text you want and now that will be the Text that shows up before whatever command you type in so you can type in prompt Hello, and now it will say hello. And then you type the commands after that having just some random word.
There is not going to be very useful so you can actually use the command prompt and then space/ ? to show special codes that you can use to not just have words but also dynamic information there as well such as a Timestamp or the version of Windows and stuff like that So for example, maybe we don't want it to just show the file path. But we also want to have it as a timestamp So if you're looking at a log later down the road, you know exactly when these commands are run So to do this you can look at the special codes and what we would want to type in is Prompt to say we're gonna change this then we would use the command dollar sign T, which is the current timestamp Code and then we're gonna do a space and then dollar sign B as a vertical line and we're just kind of formatting at this Point another space and then we're gonna use the dollar sign P command Which will show the current path just like it usually does and then we want to put that right arrow caret thing.
So we're gonna use the dollar sign G command to show the greater sign so you can see after we do that it now shows the Timestamp and then the divider line and then the file path like it did before so a little bit more useful also If you ever mess it up and you want to go back you can simply revert to the default by typing and prompt and nothing after that And it will automatically go back so you could also use this as some sort of prank if you want to mess with your friends You could have it's a catastrophic error or something like that And then they won't know what's wrong with it Might be kind of funny as long as you know how to put it back one thing to keep in mind though is that when you use this command it will reset once you restart the command prompt if you wanted to have that by default and always show your Customized one when you start command prompt you have to do a quick Registry edit now.
I'm gonna show you how to do that but as usual, if you are not experienced with the registry editor at all be very careful and maybe even avoid this trick because Messing with that registry and deleting something could literally ruin your entire version of Windows and you'll have to reinstall it So just be very careful here. So what you do is you open up the registry editor and you need to find the key That's under computer H key current user then software then Microsoft and then command Processor now on the right side after you enter that little folder you're going to right-click You're gonna create new and then string value and you want to name this autorun and after you create that you're going to right-click on that key that you just made the autorun one and click modify and then where it says value data, you're gonna type in whatever command you want to autorun as Command prompt starts up so in this case If we want the prompt command to always have a certain format that we customized like the one we just made.
All we have to do is paste in that timestamp Prompt code that we created before and now you can see when we start up command prompt it now Automatically shows that customized prompt there and this doesn't just have to be the prompt command You could have this as any command you want to run automatically when you start command prompt, so use it wisely.
No comments:
Post a Comment