Interesting Windows Extensions / Modifications / Features
Before I start today, I would like to clear that these are not my tweaks, or code snippets.
While searching for a solution to one of my problems, I came across these short, cool things for Windows.
These can be helpful for me too in future, if I forget these tricks, so I am posting them here.
1) How to open Command-prompt in a windows directory location directly:-
When you open command prompt in windows, it by default opens in desktop directory in XP or in windows-7 it opens in that user's home-space directory.
And if you open cmd using "Run as Administrator", then it opens up in "C:/windows/system32" folder.
There are multiple ways to open command prompt at a particular directory location in windows-
So here are few useful links - To add
http://www.hanselman.com/blog/IntroducingPowerShellPromptHere.aspx
Add "PowerShell here"
3) Batch rename of files in windows (but files from same directory only) -
http://www.howtogeek.com/111859/how-to-batch-rename-files-in-windows-4-ways-to-rename-multiple-files/
http://www.howtogeek.com/howto/45646/bulk-rename-tool-is-a-lightweight-but-powerful-renaming-tool/
Here is one third-party tool, which offers many other powerful ways to do it -
http://www.publicspace.net/windows/BetterFileRename/
4) Append Something to Text File using Command Prompt -
One way is using redirection operators in windows dos commands, you can read in detail about here.
Two in particular are used to output the results of a command to a file: the greater-than sign, >, and the double greater-than sign, >>.
greater-than sign (>) - sends output of command to given file, if file doesn't exist, then it will create a new one and write the output to it, if exists, then overwrites the contents.
double greater-than sign(>>) - same as greater-than-operator but instead of overwriting the previous contents of the file, this operator just appends it to the end of file (adds new line to end of file).
For more info - http://pcsupport.about.com/od/termsr/a/redirection-operator.htm
http://pcsupport.about.com/od/commandlinereference/a/redirect-command-output-to-file.htm
http://technet.microsoft.com/en-us/library/bb490890.aspx
Appending output to file using double greater-than sign (>>), it appends output to next line.
If we want to just append output to same line and not to a new line, then we can use "|" (pipe) operator.
Basically pipe operator takes output of first command and gives it as input to next command. e.g. if I want to output both date and time to append on one line of the text file.
if we use command as,
date /t >> output.txt & time /t >> output.txt
output.txt will be like (i.e. both date and time are on different lines),
01-09-2013
AM 01:50
Say, we want it (both date and time) on the same line, then command can be,
net time \\%computername% |find "Current time" >> output.txt
One more thing, if I want to print some static text, we can use echo.
echo Everything is fine >> output.txt
5) How to find if any port no is in use and by which process - there are many ways to find the same, I am just listing few, which I know.
Useful link - http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx
Helpful Links -
8) Keyboard Shortcuts - (which I didn't knew) Windows 7 supports several useful new keyboard shortcuts.
Here are links from where I got to know all above things -
While searching for a solution to one of my problems, I came across these short, cool things for Windows.
These can be helpful for me too in future, if I forget these tricks, so I am posting them here.
1) How to open Command-prompt in a windows directory location directly:-
When you open command prompt in windows, it by default opens in desktop directory in XP or in windows-7 it opens in that user's home-space directory.

There are multiple ways to open command prompt at a particular directory location in windows-
- Traditional (dumbest one) is navigate to that directory using cd (change directory) commands.
- Go inside your directory (the directory in which you wish to open command prompt), and hold Shift key and right-click (inside that directory), and select "open command window here" from right-click options.
- There is one more similar way (but from parent directory of your folder), what I mean is, while right clicking (on your directory where you want to open your command prompt) hold both Shift and Ctrl keys together and press right click of mouse.
So here are few useful links - To add
http://www.hanselman.com/blog/IntroducingPowerShellPromptHere.aspx
Add "PowerShell here"
3) Batch rename of files in windows (but files from same directory only) -
http://www.howtogeek.com/111859/how-to-batch-rename-files-in-windows-4-ways-to-rename-multiple-files/
http://www.howtogeek.com/howto/45646/bulk-rename-tool-is-a-lightweight-but-powerful-renaming-tool/
Here is one third-party tool, which offers many other powerful ways to do it -
http://www.publicspace.net/windows/BetterFileRename/
4) Append Something to Text File using Command Prompt -
One way is using redirection operators in windows dos commands, you can read in detail about here.
Two in particular are used to output the results of a command to a file: the greater-than sign, >, and the double greater-than sign, >>.
greater-than sign (>) - sends output of command to given file, if file doesn't exist, then it will create a new one and write the output to it, if exists, then overwrites the contents.
double greater-than sign(>>) - same as greater-than-operator but instead of overwriting the previous contents of the file, this operator just appends it to the end of file (adds new line to end of file).
For more info - http://pcsupport.about.com/od/termsr/a/redirection-operator.htm
http://pcsupport.about.com/od/commandlinereference/a/redirect-command-output-to-file.htm
http://technet.microsoft.com/en-us/library/bb490890.aspx
Appending output to file using double greater-than sign (>>), it appends output to next line.
If we want to just append output to same line and not to a new line, then we can use "|" (pipe) operator.
Basically pipe operator takes output of first command and gives it as input to next command. e.g. if I want to output both date and time to append on one line of the text file.
if we use command as,
date /t >> output.txt & time /t >> output.txt
output.txt will be like (i.e. both date and time are on different lines),
01-09-2013
AM 01:50
Say, we want it (both date and time) on the same line, then command can be,
net time \\%computername% |find "Current time" >> output.txt
One more thing, if I want to print some static text, we can use echo.
echo Everything is fine >> output.txt
5) How to find if any port no is in use and by which process - there are many ways to find the same, I am just listing few, which I know.
Useful link - http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx
- Using TCPView or TCPVCon -> to find which application is using which port.
- Using simple Command,
netstat -ano ,
lists all the ports in use. - If we want to find out which process is using a particular port, using a command then, netstat -ano will give you PID (process ID) of the process which is using your required port and then to find process name from PID use command, tasklist |findstr <PID> e.g. tasklist | findstr 2653
The aptly named GodMode is a built-in, yet unadvertised feature in Windows 7 that gathers all Windows utilities in one spot. To access it, simply create a new folder and name it:
GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}
or
or
myFolderName.{ED7BA470-8E54-465E-825C-99712043E01C}
It will rename itself to GodMode (or whatever name you give) and when we open it will have all the control panel shortcuts.
Useful link - http://www.pcworld.com/article/220753/windows_7_god_mode_tips_tricks_tweaks.html
From above blog, for other such special folders to create... create a batch script file and paste following (you can change folder names) -
mkdir "Special Folders
cd ".\Special Folders
mkdir "God Mode.{ED7BA470-8E54-465E-825C-99712043E01C}
mkdir "Location Settings.{00C6D95F-329C-409a-81D7-C46C66EA7F33}
mkdir "Biometric Settings.{0142e4d0-fb7a-11dc-ba4a-000ffe7ab428}
mkdir "Power Settings.{025A5937-A6BE-4686-A844-36FE4BEC8B6D}
mkdir "Icons And Notifications.{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}
mkdir "Credentials and Logins.{1206F5F1-0569-412C-8FEC-3204630DFB70}
mkdir "Programs and Features.{15eae92e-f17a-4431-9f28-805e482dafd4}
mkdir "Default Programs.{17cd9488-1228-4b2f-88ce-4298e93e0966}
mkdir "All NET Frameworks and COM Libraries.{1D2680C9-0E2A-469d-B787-065558BC7D43}
mkdir "All Networks For Current Connection.{1FA9085F-25A2-489B-85D4-86326EEDCD87}
mkdir "Network.{208D2C60-3AEA-1069-A2D7-08002B30309D}
mkdir "My Computer.{20D04FE0-3AEA-1069-A2D8-08002B30309D}
mkdir "Printers.{2227A280-3AEA-1069-A2DE-08002B30309D}
mkdir "Application Connections.{241D7C96-F8BF-4F85-B01F-E2B043341A4B}
mkdir "Firewall and Security.{4026492F-2F69-46B8-B9BF-5654FC07E423}
mkdir "Performance.{78F3955E-3B90-4184-BD14-5397C15F1EFC}
It will create all those special folders...

7) Multi-threaded Robocopy (Robust File Copy) - (type robocopy /? in command prompt to know more) Robocopy is a more robust file/directory-copying utility introduced as part of Windows Server 2003 resource kit and its been available since in all Windows OSs.
Useful link - http://www.pcworld.com/article/220753/windows_7_god_mode_tips_tricks_tweaks.html
From above blog, for other such special folders to create... create a batch script file and paste following (you can change folder names) -
mkdir "Special Folders
cd ".\Special Folders
mkdir "God Mode.{ED7BA470-8E54-465E-825C-99712043E01C}
mkdir "Location Settings.{00C6D95F-329C-409a-81D7-C46C66EA7F33}
mkdir "Biometric Settings.{0142e4d0-fb7a-11dc-ba4a-000ffe7ab428}
mkdir "Power Settings.{025A5937-A6BE-4686-A844-36FE4BEC8B6D}
mkdir "Icons And Notifications.{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}
mkdir "Credentials and Logins.{1206F5F1-0569-412C-8FEC-3204630DFB70}
mkdir "Programs and Features.{15eae92e-f17a-4431-9f28-805e482dafd4}
mkdir "Default Programs.{17cd9488-1228-4b2f-88ce-4298e93e0966}
mkdir "All NET Frameworks and COM Libraries.{1D2680C9-0E2A-469d-B787-065558BC7D43}
mkdir "All Networks For Current Connection.{1FA9085F-25A2-489B-85D4-86326EEDCD87}
mkdir "Network.{208D2C60-3AEA-1069-A2D7-08002B30309D}
mkdir "My Computer.{20D04FE0-3AEA-1069-A2D8-08002B30309D}
mkdir "Printers.{2227A280-3AEA-1069-A2DE-08002B30309D}
mkdir "Application Connections.{241D7C96-F8BF-4F85-B01F-E2B043341A4B}
mkdir "Firewall and Security.{4026492F-2F69-46B8-B9BF-5654FC07E423}
mkdir "Performance.{78F3955E-3B90-4184-BD14-5397C15F1EFC}
It will create all those special folders...

7) Multi-threaded Robocopy (Robust File Copy) - (type robocopy /? in command prompt to know more) Robocopy is a more robust file/directory-copying utility introduced as part of Windows Server 2003 resource kit and its been available since in all Windows OSs.
Helpful Links -
- http://www.computerhope.com/robocopy.htm
- https://social.technet.microsoft.com/wiki/contents/articles/1073.robocopy-and-a-few-examples.aspx
- http://technet.microsoft.com/en-us/magazine/ee851678.aspx
8) Keyboard Shortcuts - (which I didn't knew) Windows 7 supports several useful new keyboard shortcuts.
- Alt + P = Display/ hide the Explorer preview pane,
- Windows key+ G = Display gadgets in front of other windows,
- Windows key+ + (plus key) = Zoom in, where appropriate,
- Windows key+ - (minus key) = Zoom out, where appropriate,
- Windows key+ Up = Maximize the current window,
- Windows key+ Down = Minimize the current window,
- Windows key+ Left = Snap to the left hand side of the screen,
- Windows key+ Right = Snap to the right hand side of the screen,
- Windows key + Home = Minimize/ restore everything except the current window,
- Ctrl+Shift+N = New Folder creation shortcut, to create the folder in the active Explorer window, then type its name as usual.
- http://www.computerworld.com/s/article/9140414/Windows_7_tricks_20_top_tips_and_tweaks
- http://www.techradar.com/us/news/computing-components/85-windows-7-tips-tricks-and-secrets-643861
- http://www.allindiadaily.com/2013/08/more-than-100-keyboard-shortcuts.html
Comments
Post a Comment