RafaelWolf.com

The son of "The most interesting man in the world" (Dos Equis )

Browsing Posts in Uncategorized

Here’s another cool for loop example:

Create an “alphabet.txt” file containing all the letters in the alphabet beginning with d.

d
e
f
g
,etc, etc, etc

for /f %%i in (alphabet.txt) do if exist %%i:\USMT\*.* xcopy %%i:\USMT\*.* /e /v /y C:\Windows\USMT\

I picked this up from a Windows 7 document M$ posted about the “User State Migration Tool”.  In the document found > here < they give an example for you to run the USMT from a pen drive.  They had this command set.

If exist D:\USMT\*.* xcopy D:\USMT\*.* /e /v /y C:\Windows\USMT\
If exist E:\USMT\*.* xcopy E:\USMT\*.* /e /v /y C:\Windows\USMT\
If exist F:\USMT\*.* xcopy F:\USMT\*.* /e /v /y C:\Windows\USMT\
If exist G:\USMT\*.* xcopy G:\USMT\*.* /e /v /y C:\Windows\USMT\
If exist H:\USMT\*.* xcopy H:\USMT\*.* /e /v /y C:\Windows\USMT\
If exist I:\USMT\*.* xcopy I:\USMT\*.* /e /v /y C:\Windows\USMT\
If exist J:\USMT\*.* xcopy J:\USMT\*.* /e /v /y C:\Windows\USMT\
If exist K:\USMT\*.* xcopy K:\USMT\*.* /e /v /y C:\Windows\USMT\

This is pretty trivial (I know) but it certainly cleans up the batch file should I decide to add more information in it or if I add this to a larger set of tools, maybe a utility menu where this is merely just an option for other technitians to use.  Should I need to add more than just a “copy data from my pen drive to my hard drive” in the future I could easily do so and it’s a great reference for people looking for for loop examples.  For more for loop examples click > here <

Most of the stuff I post here are technical notes turned blogs so we can all bennefit!

I have a client who I recommended upgrading to a reliable and inexpensive managed switch.  We took 3 D-Link gigabit switches and consolidated to one 48 port TrendNET TEG-448WS Gigabit Switch.  I must admit, I was a bit nervous putting all our eggs into one basket.

We bought the switch from NewEgg and it only had one review.  The reviewer said the switch was slow on large data transfers and they didn’t speak highly of it.  We took a small calculated risk and boy did it pay off.

Switch has been up for 376 days and counting with not one xfer error!

Powered by WordPress Web Design by SRS Solutions © 2010 RafaelWolf.com Design by SRS Solutions
8 visitors online now
8 guests, 0 members
Max visitors today: 8 at 07:37 am GMT+5
This month: 14 at 09-07-2010 06:16 pm GMT+5
This year: 36 at 08-30-2010 02:32 am GMT+5
All time: 36 at 08-30-2010 02:32 am GMT+5