Windows XP Tips

Tips for Windows XP and later

(This section is now obsolete, but kept here for government workers).
  1. First Things to Change on a new XP Windows System
    1. Turn off nagging "Delete Warning".

      Right Click on th Recycle Bin, select "Properties" and uncheck "Display delete confirmation dialog" box. You can always get the deleted file from the Recycle Bin anyway.

    2. Turn on showing of extensions

      In Windows Explorer, select "Tools/Folder Options.../View" and unselect "Hide extensions for known file types". It's dangerous not to have it on. You can download a picture with a ".jpg" extension in the file name, but the real extension could be ".exe".

    3. Rename the extension on multiple files

      To rename all xyz.jpeg to xyz.jpg enter "C:> ren *.jpeg *.jpg"

    4. Turn on ClearType

      Start/Settings/Control Panel/Display/Appearance/Effects then set "Use the following method to smooth edges of screen fonts" to "ClearType". While you're there, uncheck "Show window contents while dragging", and "Hide underlined letters for keyborad..."

    5. Download Firefox.

      Add these extensions: Linky, HTML Validator, Reload Every, Dictionary Search, Web Developer, Open Link In..., AdBlock, StumbleUpon, Linky, GreaseMonkey, Mouse Gestures Redox 2.0.3, Tab Mix Plus, Google Browser Sync, Tamper Data.

    6. add "C:\WINDOWS\system32\taskmgr.exe" to the startup menu so it launches at reboot

      In Windows Explorer Select "Tools/Folder Options.../General/Double-click to open an item"

    7. Download TweakUI.exe to skip the windows xp logon screen.

      Select "Start/Programs /Powertoys for Windows XP". Then select "Logon/Autologon" and check your main userid.

      Select "Common Dialogs/Places Bar" and enter your favorite download sites.

    8. Install Unbuntu as dual boot.
    9. Set Windows to be the default operating system to be selected by GRUB

      sudo gedit /boot/grub/menu.lst

      set the line "default 0" to contain the number of the windows boot, typically 4.

  2. Easy (Fairly) Safe Steps to Make Windows XP Faster
    1. Set XP for high performance.

      Right Click on "My Computer", select "Properties", select the "Advanced" tab, under the "Performance" area select "Settings", select "Adjust for best performance" then select "OK".

    2. Disable Automatic Searching of Network Folders and Printers

      In Internet Explorer select "Tools/Folder Options.../View" and uncheck "Automatically search for network folders and printers."

    3. Turn off Auto Indexing

      Windows comes with an annoying indexing service, it's better to turn it off and use Google or Yahoo's desktop search engine instead. In windows explorer, right click on your "C:" drive. Select "Properties", then look at the "General" tab. At the bottom uncheck "Allow Indexing Service..."

    4. Look at your "Recycle Bin" and empty it if you really don't need those files.
    5. Disk Cleanup

      On that same tab select "Disk Cleanup" and wait a few minutes. A window will appear with checkboxes. Check "Temporary Internet Files", "Offline Web Pages", "WebClient/Publisher Temporary Files", and "Temporary files". Check the others at your own risk. Leave the "Office Setup Files" as is. Don't make Office mad at you. Then select "OK".

    6. Defrag the drive

      Whether or not this helps is up for debate, but it won't hurt your system. In windows explorer, right click on your "C:" drive. Select "Properties", then look at the "Tools" tab. Select "Defragment Now...", then select "Defragment".

      Better yet, you can schedule a job to defrag your drive. Create a batch file, defragger.bat,

      date/t & time/t
      C:\WINDOWS\system32\defrag.exe C: -v 
      date/t & time/t
      

      And then schedule "defragger.bat > c:\defrag.txt" to run once a week or month (or if your obsessive like me, once a day at 2am). See note below for details on scheduling.

    7. Remove extra startup processes

      Select the "Start" button, then "Programs", then "Startup". Look at the programs that are automatically started each time you reboot. Right click on any that are not necessary and delete them.

    8. Remove extra programs

      Select "Start", "Settings", "Add Remove Programs" and waste anything you don't need anymore.

    9. Remove SpyWare and Adware

      tips on removing SpyWare.

    10. Remove extra graphical effects

      Right click "My Computer", select "properties" select "advanced", select "performance settings". Check "adjust for best performance" and uncheck every check.

    11. Turn off error reporting in Windows XP

      When a process is dying, dumprep.exe will gather up the pieces and send them to Microsoft for an CSI exam; well that's the idea. Do you really think they look at millions of core dumps to make XP better? yeah, I don't either. Anyway, to turn it off, Right click on "My Computer", select "Advanced/Error Reporting/'Disable error reporting'". Your computer will be happier.

  3. Installing a second hard drive

    After phyiscally installing the drive select "Start/Settings/Control Panel/Admin/Computer Management/Storage/Disk Management". Find your new drive in the list, right click and select "New Partion...". Take the defaults of the Partion Wizard. (If a new drive you can select "Quick Format").

  4. How to map drive to a directory.

    This will create an "E:" drive and map it to the "C:\Edrive" directory.

    subst E: "C:\Edrive"
    
  5. How to schedule a task in windows XP

    To schedule a task, click Start, select Programs, select Accessories, select System Tools, select Scheduled Tasks.

  6. How to restart the audio

    Annoyingly, the audio will just stop working for no apparent reason. Shut down all applications that could possibly think of using audio, like browsers and ITunes. Go to the services panel (Start/Control Panel/Administrative Tools/Services), select "Windows Audio", cross your fingers, start and stop it a few times. This sometimes works.

  7. What version of the .Net Framework do I have?

    Look at the directory C:\WINDOWS\Microsoft.NET\Framework. Each version of .Net will have its own subdirectory. If you see a directory named "v2.0.50727", you have .Net version 2.0. You will probably have more than one version on your box. There are many copies. And they have a plan.

  8. How to restart IIS from the command line?
    iisreset
    
  9. Set the Start Directory in Windows Explorer

    Right-click on the Windows Explorer icon (on the desktop, if you've dragged it there or via the start menu). Select "Properties". To have Explorer start at the top of the C: drive, replace the value of "Target" with the following:

    %SystemRoot%\explorer.exe /e, C:\
    
  10. How to map a local drive to a disk drive letter?

    The "subst" command makes a new virtual disk drive. Here we are mapping "C:\EDrive" to "E:". Use "/D" to delete a virtual drive reference, and "/?" to get all options.

    subst E: C:\EDrive
    
  11. Excel - How to extract only the date from a datetime cell?

    Excel stores datetime as a serial number, e.g., 41154.3632011, where the decimal portion is the hours, minutes, seconds portion. So, by using the "int" function you can grab only the date, e.g., "=int(a1)"

  12. Excel - How to exchange rows and columns?

    Select the data and copy it to the clipboard
    Click where you want the data - must be outside the selected area.
    Choose edit / paste special and check the "transpose" box

  13. Excel - How to interpolate missing data in a chart

    Replace the empty or "NULL" cells with the special formula "=NA()" (not available).
    Right click in your chart and select "Select Data Source", then click on "Hidden and Empty Cells", and set your preferences.

  14. Excel 2007 - How to add hours to a date

    To add two hours to the date in A1: =A1+"2:00"
    or
    =A1+TimeValue("00:02:00")

  15. Certificates
    1. How to create a self-signed certificate
      makecert -r -pe -n "CN=mydomain.com" -b 01/01/2000 -e 01/01/2036 -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localMachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12
      
    2. How to install the newly created certificate

      Open "Internet Information Services", right click on "Default Web Site", select the "Directory Security" tab, select the "Server Certificate..." button.

    3. How to apply it to a virtual directory

      Open IIS, right-click on the virtual directory, select the "Directory Security" tab. Under "Secure communications", select "Edit..." then check "Require secure channel (SSL)".

  16. To use 'vi' from the SFU package in the cmd shell

    Set the terminal type to interix, i.e., set TERM=interix

  17. Shortcuts:
    Windows-F launch the "Find" utility
    Windows-E launch Windows Explorer
    Shift-F10 open the right click context menu. Useful for creating files in Windows Explorer.
    Shift-F3 toggle selected text between upper-case, lower-case, and title case
  18. How to get rid of that annoying "Send Error Report to Microsoft" popup:
    1. On the "My computer" icon, right click and select "Properties"
    2. Select the "Advanced" tab, and then "Error Reporting"
    3. Select "Disable error reporting" and uncheck the "But notify me..." option.
    
  19. To see what speed your processor is

    In the file browser, right click on "My Computer" and select "Properties". The speed and RAM details are on the "General" tab.

  20. To create an Emergency Repair Disk:

    Start/Run/rdisk

  21. To map a drive:

    net use z: \\vulcan\development /user:MyDomain\myusername /persistent:yes

  22. To access a cd drive from a distant virtual machine

    When installing software on a virtual you often need to access a cd drive on a different machine. Go to the machine with the cd drive and share the cd drive as "d". On the virtual map a drive like "M:" to that other drive e.g., "\\mymachine001\d". Enjoy.

  23. To view which programs are associated with which extensions
    assoc
    
  24. How to turn on showing of file extensions:

    In Windows Explorer select "Tools/Folder Options.../View" and uncheck "Hide extensions for known file types"

  25. To print a window.
    1. PrtScrn will put a snapshot of the entire screen into the Clipboard;
      "Alt-Print Scrn" will save only the active window.
      Ctrl-"PrintScrn" -- pastes the current window into the clipboard
    2. Open "Paint" program and do a paste.
  26. Display a complete tree

    In Windows NT Explorer and in Microsoft Outlook, if you select a folder then press "*" on the numeric keypad (Num Lock can be on or off), the entire tree of sub-folders under the selected folder will be expanded. Pressing "-" on the keypad will collapse the tree again.

  27. Miscellaneous
    -----------------------------------------------------------
    from http://www.jsiinc.com/reghack26.htm#T501
    How do I pipe the entire contents of a batch file (commands and responses) to a log file?
    
    The syntax is:
    Drive:\BatFolder\BatchName.bat>Drive:\LogFolder\LogName.log 2>&1
    
    If you wish to fully log a scheduled job, put the command in another batch file. Example: c:\zzz\batch0.bat contains:
    
    c:\zzz\batch1.bat>c:\temp\batch1.log 2>&1
    
    Then schedule c:\zzz\batch0.bat:
    
    AT hh:mm cmd /c "c:\zzz\batch0.bat" 
    -----------------------------------------------------------
    From http://ci.ml.org/ntsecrets/info/secrets.htm
    Question: How do I schedule a batch job to run automatically?
    Answer: Start/Programs/Accessories/System Tools/Scheduled Tasks
    
    -----------------------------------------------------------
    *******************************************************************
    From ZDNet:
    
    Scheduling a reboot of your server
    
    If you would like to reboot your Windows NT server, but don't want
    to have to be there to do it, you can use the shutdown Windows NT
    Resource Kit utility, along with the at command, to schedule a
    reboot of your server.
    
    (You can download the Windows NT 4.0 Resource Kit Support Tools,
    which include the shutdown utility, by going to
    http://www.microsoft.com/ntserver/nts/downloads/recommended/ntkit/
    default.asp. The at command is included with Windows NT Server 4.0.)
    
    The shutdown utility requires that you use several parameters.
    These include /L (to specify that you want to shut down the local
    computer), /R (to specify that you want to reboot after the
    shutdown of your server), and /Y (to specify that you want to
    answer "yes" to all questions). For example, to shutdown and reboot
    your local server, you should type:
    
    shutdown /L /R /Y
    
    When you're ready to schedule the shutdown command to run, begin by
    starting the Schedule service in the Services icon within Control
    Panel. After starting the Schedule service, schedule shutdown to run
    by typing the following command: at time /next:date command. For
    example, to schedule the shutdown to run every Saturday at 3:00 P.M.,
    type the command:
    
    at 15:00 /every:Saturday c:\ntreskit\shutdown /L /R /Y
    
    
    to change the title on a command window in NT
    c:>title my new title
    
    to change the permissions on the command line (like chmod)
    attrib -r myfile.dat
    
    To put multiple commands in a console, separate them with '&'
    
    c:>dir & pwd
    
    You can change the Start menu delay in displaying sub-menus.  Bring up
    REGEDT32.  Go to HKEY_CURRENT_USER\ControlPanel\Desktop,
    MenuShowDelay:.  Set REG_SZ: to anything between 0 (fastest) and 4000
    (slowest).
    
    Launch Windows NT faster by adjusting the boot delay to 5 seconds or
    less.  To make the change, open Control Panel/System and select the
    Startup/Shutdown tab.  In the Show List For control, change the
    setting to the desired boot delay value.  To bypass the boot menu
    altogether, set the delay value to 0. 
    
    To refresh explorer enter F5.
    
    C:\>path=%PATH%;c:\fincher\bin
    
    If you want to be able to depress the TAB key to complete the file name you are typing at a command prompt, edit:
    HKEY_CURRENT_USER/Software/Microsoft/Command Processor
    Double Click on CompletionChar or add value of REG_DWORD, set it to 9. You will need to reboot. 
    
    c:>nbtstat -R
    Successful purge and preload of the NBT Remote Cache Name Table.
    
    c:>netstat -a
    network status command for ports
    
    net use z: \\othermachinename\c
    to map a drive from another machine to z
    
    c:> net use //shows mapped drives
    
    c:> net user username // shows characterics of user like when the password expires
    
    c:> net view /domain: mycompanydomain  // finds machines on the net
    
    c:\winnt\system32\drivers\etc\Hosts
    is where the local dns filelookup table lives.
    
    
    c:START notepad
    does a batch invocation, like & in unix
    
    CNTL-ESC is the same as the windows key.
    
    net send mfincher howdy mitch
    to send a message to mfincher on windows network
    
    net send /users "this is sent to all users of the machine."
    
    net send mfincher "this is a message only for mitch"
    
    
    In Internet Explorer to expand all folders below the currently selected
    one, press the "*" on the numeric keypad (not the "*" on the 8 key).
    
    
    To have a batch file "sleep" or "wait" use:
    perl -e "sleep(3);"
    
    
  28. To start and stop IIS from the command line
    net START "World Wide Web Publishing Service"
    net STOP "World Wide Web Publishing Service"
    
  29. End of line characters
    		dos is CRLF
    		mac is CR
    		Unix is LF
    
  30. recursively copy over a network:
    xcopy /e mydir1\* \\venus\\usr\mydir1
    
  31. Postscript command for duplex printing Right before the line starting with "%%BeginProcSet: ", insert the following two lines:
    % Enable Duplex printing
    << /Duplex true >> setpagedevice
    
  32. Windows NT reboot
    You can force NT to automatically reboot after a crash by setting the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\CrashControl\AutoReboot to 1.
  33. To remove a directory:
    rd x:\folder /S
    Replace x:\folder with the drive letter and name of the folder you want to delete. use
    rd x:\folder /S /Q
    to have rd use "quiet" mode so it won't give you all the messages and warnings.
  34. To configure your ip settings
    winipcnfg
    
  35. To see your cached dns sites
    ipconfig /displaydns 
    
  36. To flush (or reset) your dns settings
     ipconfig /flushdns
    
  37. To see your proxy settings:
    proxycfg
    
  38. Toimport your proxy settings from IE
    proxycfg -u
    
  39. Misc windows key settings: (from Ian P. Springer [ips@fpk.hp.com])
    [Windows]F: Opens the Find dialog box
    [Windows]M: Minimizes all open windows
    [Windows]R: Opens the Run dialog box
    [Windows][Break]: Opens the System Properties dialog box
    [Windows][Tab]: Cycles through the programs on your taskbar
    [Windows][F1]: Opens Windows NT Help (regardless of the program you're
    working in--pressing [F1] by itself opens the current program's Help)
    
    
    bonus: [Ctrl][Shift][Esc] start Task Manager
    
  40. Why does only the first line of this Windows batch file execute?

    Try putting a "call " infront of the first command.

    call togglesql
    osql -S MyBoxName -E -Q "drop database SwitchBoard"
    osql -S MyBoxName -E -Q "create database SwitchBoard"
    
  41. Command line programs
    DescriptionCommand
    Add/Remove Programs appwiz.cpl
    Administrative Tools certmgr.msc
    Check Disk Utility chkdsk
    Clipboard Viewer clipbrd
    Command Prompt cmd
    Component Services dcomcnfg
    Computer Management compmgmt.msc
    Date and Time Properties timedate.cpl
    Device Manager devmgmt.msc
    Direct X Control Panel (If Installed) - directx.cpl
    Direct X Troubleshooter dxdiag
    Disk Cleanup Utility cleanmgr
    Disk Defragmnt dfrg.msc
    Disk Management diskmgmt.msc
    Disk Partition Manager diskpart
    Display Properties (w/Appearance Tab Preselected) - control color
    Display Properties control desktop
    Display Properties desk.cpl
    Event Viewer eventvwr.msc
    Findfast findfast.cpl
    Folders Properties control folders
    Fonts Folder fonts
    Fonts control fonts
    Free Cell Card Game freecell
    Game Controllers joy.cpl
    Group Policy Editor gpedit.msc
    Hearts Card Game mshearts
    IP Configuration (Delete DNS Cache Contents) - ipconfig /flushdns
    IP Configuration (Display Connection Configuration) - ipconfig /all
    IP Configuration (Display DHCP Class ID) - ipconfig /showclassid
    IP Configuration (Display DNS Cache Contents) - ipconfig /displaydns
    IP Configuration (Modifies DHCP Class ID) - ipconfig /setclassid
    IP Configuration (Refreshes DHCP & Re-Registers DNS) - ipconfig /registerdns
    IP Configuration (Release All Connections) - ipconfig /release
    IP Configuration (Renew All Connections) - ipconfig /renew
    Iexpress Wizard iexpress
    Indexing Service ciadv.msc
    Internet Properties inetcpl.cpl
    Java Control Panel (If Installed) - javaws
    Keyboard Properties control keyboard
    Local Security Settings secpol.msc
    Local Users and Groups lusrmgr.msc
    Logs You Out Of Windows logoff
    Microsoft Chat winchat
    Minesweeper Game winmine
    Mouse Properties control mouse
    Mouse Properties main.cpl
    Netstat netstat
    Network Connections control netconnections
    Network Connections ncpa.cpl
    Network Setup Wizard netsetup.cpl
    Notepad notepad
    Nview Desktop Manager (If Installed) - nvtuicpl.cpl
    ODBC Data Source Administrator odbccp32.cpl
    Object Packager packager
    On Screen Keyboard osk
    Opens AC3 Filter (If Installed) - ac3filter.cpl
    Password Properties password.cpl
    Performance Monitor perfmon.msc
    Performance Monitor perfmon
    Phone and Modem Options telephon.cpl
    Power Configuration powercfg.cpl
    Printers Folder printers
    Printers and Faxes control printers
    Private Character Editor eudcedit
    Quicktime (If Installed) - QuickTime.cpl
    Regional Settings intl.cpl
    Registry Editor regedit
    Remote Desktop mstsc
    Removable Storage Operator Requests ntmsoprq.msc
    Removable Storage ntmsmgr.msc
    Resultant Set of Policy (XP Prof) - rsop.msc
    SQL Client Configuration cliconfg
    Scanners and Cameras sticpl.cpl
    Scheduled Tasks control schedtasks
    Security Center wscui.cpl
    Services services.msc
    Shared Folders fsmgmt.msc
    Shuts Down Windows shutdown
    Sounds and Audio mmsys.cpl
    Spider Solitare Card Game spider
    System Configuration Editor sysedit
    System Configuration Utility msconfig
    System File Checker Utility (Purge File Cache) - sfc /purgecache
    System File Checker Utility (Return to Default Setting) - sfc /revert
    System File Checker Utility (Scan Immediately) - sfc /scannow
    System File Checker Utility (Scan On Every Boot) - sfc /scanboot
    System File Checker Utility (Scan Once At Next Boot) - sfc /scanonce
    System File Checker Utility (Set Cache Size to size x) - sfc /cachesize=x
    System Properties sysdm.cpl
    Task Manager taskmgr
    Telnet Client telnet
    Traceroute tracert <hostname or IP>
    User Account Management nusrmgr.cpl
    Utility Manager utilman
    Windows Firewall firewall.cpl
    Windows Magnifier magnify
    Windows Management Infrastructure wmimgmt.msc
    Windows System Security Tool syskey
    Windows Update Launches wupdmgr
    Windows XP Tour Wizard tourstart
    Wordpad write
  42. Command looping in winnt
    Consider the following command:
    
    FOR /L %g IN (1,1,254) DO ping -n 2 200.200.200.%g
    
    In English, this command states that we want to "do" the ping command as long 
    as the %g variable is within the range from 1 to 254. We specify the range for 
    %g by using the syntax (start, step, end). Start indicates the starting value 
    for %g (1 in this example), step indicates the number with which we want to 
    increment %g (1 in our example), and end indicates the number at which we want 
    to stop pinging. We've also limited the number of pings to 2 by using -n 2 
    (instead of the typical 4 for each computer. 
    
    When you run this command, you'll see that your computer pings the following 
    IP addresses:
    
    200.200.200.1
    200.200.200.2
    200.200.200.3
    ...
    200.200.200.254
    
    This tip was contributed by Rafael Sanchez, fariceo@yahoo.com.
    
  43. Create a CD disk that automatically launches a web page Create an autorun.inf file with the following contents and it will launch Internet explorer and show the "index.htm" page:
    [autorun]
    label=Eagles 2000
    open=explorer.exe index.htm
  44. Simulate a sleep or wait call

    "-n" is the number of pings, which could roughly be proportional to the amount of time to wait in seconds. This is not really elegant, or even recommended, but in a pinch, it'll work to wait 5 seconds.

    C:\WINDOWS\system32\ping.exe 127.0.0.1 -n 5 -w 5000  > nul
    
  45. Redirect std out and std error to the same file
    MyCommand > My.log 2>&1
    
  46. Embed the date and time into a filename

    MyCommand > MyDataFile_%date:~10,4%-%date:~4,2%-%date:~7,2%-%time:~0,2%-%time:~3,2%-%time:~6,5%.log
    

    This produces:

    MyDataFile_2009-12-18-14-35-58.71.log
    
  47. Loop over arguments using SHIFT in a command batch file
    rem loops through the arguments and qparses the qqc file
    rem example of how to use SHIFT to process arguments - also see FOR
    @echo on
    :LOOP
    echo "Compiling %1"
    cd C:\mrInterviewSource
    cd %1
    call c:\home\mfincher\bin\qparse.bat %1
    SHIFT
    IF "%1" == "" GOTO END
    GOTO LOOP
    
    :END
    echo "All Done."
    
  48. To see running processes (similiar to "ps" in unix)

    "tasklist"

  49. To kill a process (similiar to "kill" in unix)

    taskkill /IM [BadExecutable].exe

  50. To see which version of Windows am I running

    Select "Start/Run" and enter "winver"

  51. To view assemblies in the GAC (Global Assembly Cache) for pre-.Net 4.0 assemblies enter this in Windows Explorer
    %windir%\assembly\
    

    This will invoke the shfusion shell extension in Windows Explorer.

    You can also use "gacutil.exe" to play with the GAC.

    For .Net 4.0 check out %windir%\Microsoft.NET\assembly