Archive for January, 2009

Tips and Tricks - robocopy.exe and subinacl.exe

Ever wanted to copy a large file across the network and cope with resuming where you left off when the remote desktop session kills your copy?

Well now you can!

Robocopy is an excellent piece of kit, distributed as part of the windows resource kits for Windows 2k, XP Pro and 2003 Server.

Subinacl allows you to take ownership of your files in bulk!

Here is a neat trick from Solo Enterprises… I’ve stolen it (it copies the contents of a hard drive) and made some amendments below:

Requirements:

  • Windows 2000,XP Pro, 2003 Server
  • robocopy.exe- in the windows resource kits or download here (save as)
  • subinalc.exe- in the windows resource kits or download here (save as)

Conventions:

  • For this example we will assume that
  • robocopy.exe and subinacl.exe are in your local PATH
  • The C: drive is your main hard drive
  • I generally pull the harddrive out of the client computer and transfer the data from a workstion to our backup server using a removable drive tray.
  • the SOURCE is the F: Drive and is an NTFS file system. (if not NTFS, just remove the first line in the batch file below)
  • The SOURCE is NOT the partition that is running Windows currently.
  • the destination is a mapped network folder T:\test

Install both of these and then create a new text file called robocopy.cmd on your desktop.

Line 1 will use subinacl to take ownership of all the file on the SOURCE and give Everyone Full Control of the files and folders. I had to do this because some security settings will cause a failure copying files. Especially ones in application data and local settings.

start /wait subinacl.exe /errorlog="C:\errorlog.txt" /nostatistic
/subdirectories F: /Owner=user@machine.local /grant=Everyone=F
/objectexclude=*.swp
/objectexclude=*.dmp
/objectexclude=*.tmp
/objectexclude=pagefile.sys
/objectexclude=hiberfil.sys

  • start /wait subinacl .exe //this starts the script and waits for it to complete before moving to the next line in the batch file
  • /errorlog="C:\errorlog.txt" //this saves an error log to the path specified
  • /nostatistic //this suppresses displaying the progress
  • /subdirectories //Makes it do all files and subdirectories in the path specified
  • F: //Path to hard drive
  • /Owner=user@machine.local //Who takes ownership of the files
  • /grant=Everyone=F //Grant Everyone Full Permissions
  • /objectexclude=*.tmp // no need wasting time on a file we aren’t going to copy.

Line 2 Will robocopy the entire contents of the harddrive expect: *.swp *.dmp *.tmp pagefile.sys hiberfil.sys "_RESTORE" "MSOCache" "Recycled" "RECYCLER" "Temporary Internet Files" "System Volume Information" "WUTemp"

I don’t copy those files because I have never run into a time when I needed anything in any the folders and it just wastes time to copy them.

start /wait robocopy.exe F:\ T:\test /E /ZB /COPY:DAT /IA:RASHNTCEO /X /V /FP /XF *.swp *.dmp *.tmp pagefile.sys hiberfil.sys /XD  "_RESTORE" "MSOCache" "Recycled" "RECYCLER" "Temporary Internet Files" "System Volume Information" "WUTemp" /R:1 /W:0 /LOG:"C:\robolog.txt" /TEE
  • start /wait robocopy .exe //this starts the script and waits for it to complete before moving to the next line in the batch file
  • F:\ //Source
  • T:\test //Destination

So now just double click robocopy.cmd on your desktop and away it goes…

Enjoy

SpittingCAML



Windows 7 - Build 7000, Beta 2… Testing testing 1-2-3

Happy new year all!

I’ve started the year rather slowly, so I haven’t had anything blog-worthy to write as of yet, however I thought I’d share some screenshots of the Windows 7 (x64) Beta 2 install and a very brief test.

If you are an MSDN subscriber with the relevant subscription, you should be able to join me in the Beta test of Windows 7.

I’m going to be testing Windows 7 using VMware Workstation, version 6.5.1. VMware workstation detects the ISO image of Windows 7 (x64) as Windows Vista (x64). I have left the default settings where possible.

windows7_install_11
Figure 1 - VMware workstation, configuration and version.

We begin the install, VMware boots from the ISO image.

windows7_install_01
Figure 2 - the install begins

You are greeted with a flashy animation, which morphs into the Windows icon, as shown in Figure 2.

windows7_install_02
Figure 3 - you are able to select which version you’d like to try out. I selected Windows 7 Ultimate.

windows7_install_03
Figure 4 - the installer shows a progress bar at the bottom.

windows7_install_04
Figure 5 - following the install, the computer reboots and displays this screen

windows7_install_05
Figure 6 - The new windows desktop, and the windows update screen. I was unable to detect any updates when I ran this

windows7_install_06
Figure 7 - Internet Explorer 8 Beta

windows7_install_07
Figure 9 - The new task bar, that now shows you each tab in IE8. Tasks are now shown by Icon and grouped.

windows7_install_09
Figure 10 -  The new task bar shows Calculator and ‘Sticky Notes’ running under their icons.

windows7_install_10
Figure 11 - the gadget sidebar from Vista is gone, you can now place your gadgets wherever you like!

I am surprised to report that Windows 7 (x64) seems more responsive than Windows Vista (x64) when running in a Virtual Machine. Could Microsoft have tuned this OS a little better? I hope so!

The speed could be down to the core i7 chip that is in my host PC so I would be grateful if you could let me know how you get on with your own Beta tests.

windows7_install_12
Figure 12 - information about the Virtual Windows 7 PC

I hope to do a little more delving into the changes implemented in this new OS. I will keep you posted.

SpittingCAML




You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.