Robocopy – Best Damn Windows Comand line Copy Util!

I’m a huge fan of the windows robocopy program.  It allows you to perform migrations and copies between servers. Recurvsive copy capabilities are included as well as copies based on file archive bit settings.

Basic Robocopy syntax:

robocopy <source dir> <destination dir> <file> <options>

Copy 1 file:

robocopy c:\test\ d:\test move-this-file.txt /z /r:1 /w:1 /v /eta /e /L

/z = copy the file in restartable mode… if the file copy breaks it will just pick up where it left off.

/r:1= When copying a large number of files and or folders I always set the retry count to be really low. That way if it gets hung up on a file it just skips it.

/w:1= Same as /r except this pertains to the wait timeout. ie. if there is a ton of latency the file is skipped.

/v = show output on screen during the copy

/eta = show me how long it expects the copy to take

/e = recursively copy all sub folders and files including empy ones empty directories.

/L ALWAYS use /L before running any robocopy script or command. It will show you what is going to be copied by the command being run.

Robocopy is included in the Windows 2000+ Resource pack which can be download in my Utilities link found at the top of the page.

RDP – Force Console Access

With large managed corporate environments I’ve noticed that many people don’t properly log out of active RDP sessions.  The result of this scenario is that all licensed RDP connections (default = 2) are used up and Admins cannot connect to a server without either somehow booting someone from the box or gaining console access.

There is a simple and easy resolution to this issue.  By using windows built in tools you can force console access to any server running RDP.  Windows provides the utility called mstsc which can be run from a command window with a force parameter.  This will either give you a 3rd connection to the server (console) or give you the option of booting off a user who has been idle or disconnected from the server for an extended period of time.

Bottom line… use this command! 🙂
mstsc -v:<server name> /F -console

NOTE: This command no longer works… refer to this post for the updated syntax.

Fix – iPhone stuck at pineapple boot screen

Symptom: iPhone won’t boot, hangs at pineapple boot screen
Fix: Put iPhone in DFU mode.

  1. Launch iTunes
  2. Connect iPhone to computer via USB cable
  3. Shut iPhone off (press and hold sleep/power button)
  4. Reset iPhone by pressing & holding both the power button and home button (Note Screen will be blank)
  5. Release power button after 10 seconds
iTunes will now recognize the iPhone in DFU mode. It will then give you the option of restoring it.
Restoring an alternative .ips file within iTunes.
  1. Launch iTunes
  2. Connect your iPhone
  3. On the iPhone summary screen press and hold Shift and press Restore.
  4. You will be given the option of selecting your own .ipsw file.
It appears that iTunes no longer stores the .ipsw files locally.  While this is perplexing there are alternative ways of getting the necessary .ipsw files.  The most common way is the simply download it from Apple themselves.  They keep a hidden archive which when linked directly gives you access to each .ipsw version previously released.
ipsw files can be downloaded here:

4.0.0 (3G): iPhone1,2_4.0_8A293_Restore.ipsw

4.0.0 (3GS): iPhone2,1_4.0_8A293_Restore.ipsw

4.0.0 (4): iPhone3,1_4.0_8A293_Restore.ipsw

4.0.1 (3G): iPhone1,2_4.0.1_8A306_Restore.ipsw

4.0.1 (3GS): iPhone2,1_4.0.1_8A306_Restore.ipsw

4.0.1 (4): iPhone3,1_4.0.1_8A306_Restore.ipsw

4.0.2 (3G): iPhone1,2_4.0.2_8A400_Restore.ipsw

4.0.2 (3GS): iPhone2,1_4.0.2_8A400_Restore.ipsw

4.0.2 (4): iPhone3,1_4.0.2_8A400_Restore.ipsw

4.1.0 (3G): iPhone1,2_4.1_8B117_Restore.ipsw

4.1.0 (3GS): iPhone2,1_4.1_8B117_Restore.ipsw

4.1.0 (4): iPhone3,1_4.1_8B117_Restore.ipsw

Credit where credit is due… ipsw link list source
By default iTunes stores .ipsw files in this folder:
C:Documents and SettingsAdministratorApplication DataApple ComputeriTunesiPhone Software Updates

C:Documents and Settings<user account name>Application DataApple ComputeriTunesiPhone Software Updates

iPhone 2.1 – Feature List

Performance (Only Data is now backed up & re-copied down)
 Faster Backup times (confirmed)
 Faster Update times (confirmed)

 Playlists & Songs now include the album name & artist shown bellow the track name
 Genius (song search now included)
 Added categories
    – Compilations
    – Composers
    – Audiobooks
 Podcasts (not sure if this is new… but still really cool)
– Album art work for each individual track displayed
– Ability to skip through each track found within podcast  

Parental Controls
 Restrict content (parental controls)

Reset iPhone back to factory defaults
 Reset All Settings
 Erase All Content and Settings (Full Data Erase)
 Reset Network Settings
 Reset Keyboard Dictionary
 Reset Home Screen Layout
 Reset Location Warnings

Passcode Lock
 Erase ALL data after 10 failed passcode attempts

Disable – Windows Instant Messenger

For the longest time I’ve slacked about disabling Windows Instant Messenger from loading when XP boots.  Today I finally stopped slacking and found the necessary Registry tweaks to make the little b*stard stop loading at boot. 

Fix: Using Regedit add the following Registry key & reboot.

Step by Step Instructions:

  1. Launch regedit Start -> run type regedit
  2. Drill down to the Microsoft Folder found within HKEY_LOCAL_MACHINESOFTWAREPolicies
  3. Create a Messenger folder if one does not already exist (Right click in right panel and select New Key)
  4. Create a Client folder if one does not already exist (Right click in right panel and select New Key)
  5. Right click right panel and select New -> DWORD and name it PreventRun
  6. Right click PreventRun and modify it setting it to 1
  7. Reboot Windows

Google Chrome – Mouse Scroll Issue

After installing Google Chrome on my home PC I noticed that I could only scroll down with my mouse wheel.  When attempting to scroll up the browser did nothing.  This seemed strange… since I could scroll up and down using the mouse wheel in other browsers (Safari, Firefox, IE).  

This issue has been extensively discussed in forums across the internet.  I found my fix in this sites discussion -> Solution to Google Chrome Mouse Scroll Issue

I ended up having to upgrade my mouse drivers from Microsofts site.  I have a crazy old Microsoft Wheel Mouse Optical which is both cheap and effective.  

Updated Microsoft mouse drivers can be downloaded from here: Microsoft Driver Download Site

Not only did upgrading the driver fix the issue, it also gave my mouse additional functionality. (Macro creation, better wheel manipulation capabilities etc.) 

Google Chrome can be downloaded here: Download Google Chrome!

Grep equivalent for Windows (String Parsing)

The built in windows command FindStr mirrors the capabilities of the Unix command Grep.

Findstr /?
FINDSTR [/B] [/E] [/L] [/R] [/S] [/I] [/X] [/V] [/N] [/M] [/O] [/P] [/F:file]
        [/C:string] [/G:file] [/D:dir list] [/A:color attributes] [/OFF[LINE]]
        strings [[drive:][path]filename[ …]]
  /B         Matches pattern if at the beginning of a line.
  /E         Matches pattern if at the end of a line.
  /L         Uses search strings literally.
  /R         Uses search strings as regular expressions.
  /S         Searches for matching files in the current directory and all
  /I         Specifies that the search is not to be case-sensitive.
  /X         Prints lines that match exactly.
  /V         Prints only lines that do not contain a match.
  /N         Prints the line number before each line that matches.
  /M         Prints only the filename if a file contains a match.
  /O         Prints character offset before each matching line.
  /P         Skip files with non-printable characters.
  /OFF[LINE] Do not skip files with offline attribute set.
  /A:attr    Specifies color attribute with two hex digits. See “color /?”
  /F:file    Reads file list from the specified file(/ stands for console).
  /C:string  Uses specified string as a literal search string.
  /G:file    Gets search strings from the specified file(/ stands for console).
  /D:dir     Search a semicolon delimited list of directories
  strings    Text to be searched for.
  [drive:][path]filename Specifies a file or files to search.

Example of using Findstr to search for multiple strings in succession within a log file.
findstr “ERROR Caused Fail” c:logslog.log

This command will search for the String ERROR then Caused, and Fail while parsing down a file. So if the file looked like this:
Line1: Error Script Failed
Line2: test1
Line4: Caused by process down
Line5: test2
Line6: Error2

The FindStr output would look like this:
Error Script Failed
Caused by Process down