<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6932839032613249389</id><updated>2012-01-10T22:46:12.013-05:00</updated><category term='scripting'/><category term='VBA'/><category term='Virus Removal'/><category term='MySQL'/><category term='Code Reviews'/><category term='FTP'/><category term='Regular Expressions'/><category term='coding'/><category term='CMD'/><category term='UPDATE'/><category term='web development'/><category term='Internet Explorer'/><category term='RegEx'/><category term='wed design'/><category term='SQL Date Time Yesterday Last Month'/><category term='HelpDesk'/><category term='batch'/><category term='Excel'/><category term='Quality'/><title type='text'>Cameron's Technical Tricks</title><subtitle type='html'>I'm no guru, but I hope that what I find useful will help someone else. Enjoy.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>28</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-5949140324220193073</id><published>2011-07-07T08:42:00.001-04:00</published><updated>2011-07-07T08:42:39.048-04:00</updated><title type='text'>HTML Applications, VBScript, and Includes</title><content type='html'>Yes, you can use includes in HTA and VBScript applications, and there are a couple of ways to do this, but you need to control the environment quite well for success.&lt;br /&gt;&lt;br /&gt;First off someone very helpful (ebgreen) posted a function you can use to add an include &lt;a href="http://www.visualbasicscript.com/Add-a-class-function-m29285.aspx"&gt;here&lt;/a&gt;, and while I mean him or her no disrespect, the delusion of this being called a class is bothersome. It's an include, plain and simple, not a class. Of course, his routine is hardly plain and simple. What I have&amp;nbsp;gleaned&amp;nbsp;from various sources on the Internet, and created is this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;b&gt;' VBScriptWithIncFileFunctionBase.vbs&lt;br /&gt;Option Explicit&lt;br /&gt;Dim fso, oFile, sText&lt;br /&gt;set fso = CreateObject("Scripting.FileSystemObject")&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;	&lt;/span&gt;IncFile "&lt;filename&gt;"&lt;/filename&gt;&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;b&gt;sub IncFile(strFileName)&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;	&lt;/span&gt;set oFile = fso.OpenTextFile(strFileName,1)&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;	&lt;/span&gt;sText = oFile.ReadAll&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;	&lt;/span&gt;oFile.close&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;	&lt;/span&gt;ExecuteGlobal sText&lt;br /&gt;end sub&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Simple, but EBGreen's routine has error checking/handling. Our projects at work have employed EBGreen's function and it works well.&lt;br /&gt;&lt;br /&gt;No matter which method you choose to employ you must pay close attention to location. If you deploy this to &amp;nbsp;a system, you'll need to be specific about where that IncFile is located and either specify it explicitly, or change to that folder to have it available when you begin this process.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;b&gt;Set WshShell = WScript.CreateObject("WScript.Shell")&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;b&gt;'Change to the Install Folder...&lt;br /&gt;strSourceDir = "C:\ITSupport\Scripts\MyScript"&lt;br /&gt;WshShell.CurrentDirectory = strSourceDir&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;Prefixing your first call to IncFile with a change of directory should set you up nicely to proceed with success. Alternatively, you can be explicit about the location of the file name specified:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;b&gt;IncFile strSourceDir &amp;amp; "\&lt;filename&gt;"&lt;/filename&gt;&lt;/b&gt;&lt;/span&gt;&amp;nbsp;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-5949140324220193073?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/5949140324220193073/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=5949140324220193073' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/5949140324220193073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/5949140324220193073'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2011/07/html-applications-vbscript-and-includes.html' title='HTML Applications, VBScript, and Includes'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-3997936240871978119</id><published>2010-06-02T15:59:00.002-04:00</published><updated>2010-06-02T16:02:20.656-04:00</updated><title type='text'>Removing Firefox (BATCH)</title><content type='html'>For whatever reason, I had/have the task of removing Mozilla Firefox from our PCs in an automated way. I figured I could do it from a batch file, a .CMD file, but here's the proof:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;@ECHO OFF&lt;br /&gt;CLS&lt;br /&gt;ECHO Checking for Firefox...&lt;br /&gt;FOR /F "tokens=* skip=4 delims=" %%a in ('reg query "HKLM\Software\Mozilla\Mozilla Firefox" /v CurrentVersion') do SET DATA=%%a&lt;br /&gt;IF "%DATA:~31,1%"=="." goto :longVersion&lt;br /&gt;SET CVersion=%DATA:~26,5%&lt;br /&gt;SET FVersion=%DATA:~26,20%&lt;br /&gt;goto :versionCaptured&lt;br /&gt;:longVersion&lt;br /&gt;SET CVersion=%DATA:~26,7%&lt;br /&gt;SET FVersion=%DATA:~26,20%&lt;br /&gt;:versionCaptured&lt;br /&gt;&lt;br /&gt;FOR /F "tokens=* skip=4" %%a in ('reg query "HKLM\Software\Mozilla\Mozilla Firefox\%FVersion%\Main" /v "Install Directory"') do SET DATA=%%a&lt;br /&gt;SET IFolder=%DATA:~25%&lt;br /&gt;ECHO *%CVersion%*&lt;br /&gt;ECHO *%FVersion%*&lt;br /&gt;ECHO *%IFolder%*&lt;br /&gt;IF "%CVersion%"=="3.5.9" goto :DoNotRemove&lt;br /&gt;goto :RemoveFirefox&lt;br /&gt;&lt;br /&gt;:RemoveFirefox&lt;br /&gt;echo The installed version is not approved for use in our environment.&lt;br /&gt;TASKKILL /F /IM firefox.exe&lt;br /&gt;CALL "%IFolder%\uninstall\helper.exe" /S&lt;br /&gt;goto :eof&lt;br /&gt;&lt;br /&gt;:DoNotRemove&lt;br /&gt;echo This version is approved for use in our environment.&lt;br /&gt;goto :eof&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;We like version 3.5.9, so we keep that version, but we need to revert or upgrade any other version. This is part of a bigger process, but...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-3997936240871978119?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/3997936240871978119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=3997936240871978119' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/3997936240871978119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/3997936240871978119'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2010/06/removing-firefox-batch.html' title='Removing Firefox (BATCH)'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-4811347129336688731</id><published>2010-06-02T12:12:00.002-04:00</published><updated>2010-06-06T07:50:19.945-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Date Time Yesterday Last Month'/><title type='text'>Yesterday... Working with Dates</title><content type='html'>Recently we ran into an issue where we were looking into why the data wasn't being returned on the first of the month for a particular web report. What we found was simple bad math, but what I learned was that sometimes efficiencies are found in what might appear more complex.&lt;br /&gt;&lt;br /&gt;Below you will find the method used. and the problem is the subtracting of one (1) from the day of the month (&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;DAY(GETDATE())-1&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;). On the first of the month, this would result in a ZERO (0) which is impossible and will not return a result. The same can be said for using this sort of math on the month when your month is January. Not a good plan.&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;/* ---------------------------------------------&lt;br /&gt; This is the method in use...&lt;br /&gt;   --------------------------------------------- &lt;br /&gt;*/&lt;br /&gt;SELECT DISTINCT [DateModified]&lt;br /&gt;  FROM [ITDS].[dbo].[Tickets] a&lt;br /&gt;WHERE&lt;br /&gt;  YEAR(a.DateModified) = YEAR(GETDATE()) AND&lt;br /&gt;  MONTH(a.DateModified) = MONTH(GETDATE()) AND&lt;br /&gt;  DAY(a.DateModified) = &lt;span class="Apple-style-span" style="color: #38761d;"&gt;DAY(GETDATE())-1&lt;/span&gt;&lt;br /&gt;  ORDER BY [DateModified] Desc&lt;br /&gt;GO&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;Another method is to use &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;&lt;b&gt;DATEDIFF()&lt;/b&gt;&lt;/span&gt;&lt;/span&gt; as a filter on the age (1=Yesterday). This is much heavier a load on the server and you might be better-off to avoid it.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;/* ---------------------------------------------&lt;br /&gt; This method is inefficient and will impact &lt;br /&gt; performance more with large tables&lt;br /&gt;   --------------------------------------------- &lt;br /&gt;*/&lt;br /&gt;SELECT DISTINCT [DateModified], DATEDIFF(dd,a.DateModified,GETDATE()) as Age&lt;br /&gt;  FROM [ITDS].[dbo].[Tickets] a&lt;br /&gt;WHERE&lt;br /&gt;  &lt;span class="Apple-style-span" style="color: #38761d;"&gt;DATEDIFF(dd,a.DateModified,GETDATE())=1&lt;/span&gt;&lt;br /&gt;  ORDER BY [DateModified] Desc&lt;br /&gt;GO&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;Now, this combination of methods, using &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;YEAR()&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;, &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;MONTH()&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;, and &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;DAY()&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;, with the proper calculation of &lt;span class="Apple-style-span" style="color: #0b5394;"&gt;Yesterday&lt;/span&gt; is the charm. By setting the variable at the beginning, before the query, it is calculated once and the values for Year, Month, and Day are a simple comparison rather than the more complex effort that goes into &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;DATEDIFF()&lt;/b&gt;&lt;/span&gt; from our prior example.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;/* ---------------------------------------------&lt;br /&gt; This is the method adopted...&lt;br /&gt;   --------------------------------------------- &lt;br /&gt;*/&lt;br /&gt;DECLARE @Yesterday as DateTime;&lt;br /&gt;SET &lt;span class="Apple-style-span" style="color: #0b5394;"&gt;@Yesterday&lt;/span&gt;=DATEADD(dd,-1,GETDATE());&lt;br /&gt;&lt;br /&gt;SELECT DISTINCT [DateModified]&lt;br /&gt;  FROM [ITDS].[dbo].[Tickets] a&lt;br /&gt;WHERE&lt;br /&gt;  &lt;span class="Apple-style-span" style="color: #990000;"&gt;YEAR(a.DateModified) = YEAR(@Yesterday)&lt;/span&gt; AND&lt;br /&gt;  &lt;span class="Apple-style-span" style="color: #b45f06;"&gt;MONTH(a.DateModified) = MONTH(@Yesterday)&lt;/span&gt; AND&lt;br /&gt;  &lt;span class="Apple-style-span" style="color: #38761d;"&gt;DAY(a.DateModified) = DAY(@Yesterday)&lt;/span&gt;&lt;br /&gt;  ORDER BY [DateModified] Desc&lt;br /&gt;GO&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;Another advantage of this method is that if you want to filter on last month's data rather than Yesterday's it's &lt;span class="Apple-style-span" style="color: #741b47;"&gt;a few small changes&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;/* ---------------------------------------------&lt;br /&gt; This is the method adopted... Last Month&lt;br /&gt;   --------------------------------------------- &lt;br /&gt;*/&lt;br /&gt;DECLARE &lt;span class="Apple-style-span" style="color: #741b47;"&gt;@LastMonth&lt;/span&gt; as DateTime;&lt;br /&gt;SET &lt;span class="Apple-style-span" style="color: #741b47;"&gt;@LastMonth&lt;/span&gt;=DATEADD(&lt;span class="Apple-style-span" style="color: #741b47;"&gt;mm&lt;/span&gt;,-1,GETDATE());&lt;br /&gt;&lt;br /&gt;SELECT DISTINCT [DateModified]&lt;br /&gt;  FROM [ITDS].[dbo].[Tickets] a&lt;br /&gt;WHERE&lt;br /&gt;  YEAR(a.DateModified) = YEAR(&lt;span class="Apple-style-span" style="color: #741b47;"&gt;@LastMonth&lt;/span&gt;) AND&lt;br /&gt;  MONTH(a.DateModified) = MONTH(&lt;span class="Apple-style-span" style="color: #741b47;"&gt;@LastMonth&lt;/span&gt;)&lt;br /&gt;  ORDER BY [DateModified] Desc&lt;br /&gt;GO&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;The best scripters/programmers learn from their own mistakes as well as those others have made.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Addendum:&amp;nbsp;&lt;/b&gt;&lt;br /&gt;There's another way to get "&lt;i&gt;yesterday&lt;/i&gt;" that I saw, though I still believe the preferred method &lt;i&gt;might&lt;/i&gt;&amp;nbsp;be the adopted method above, where the WHERE condition would read/include:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;(a.DateModified &amp;gt;= DATEADD(dd,-1,GETDATE()) AND&amp;nbsp;a.DateModified &amp;lt;= DATEADD(dd,-0,GETDATE()))&lt;/pre&gt;&lt;/blockquote&gt;The problem I see in this methodology is that you would get the last 24-period, not "&lt;i&gt;yesterday&lt;/i&gt;" and the wastefulness of "&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;DATEADD(dd,-0,GETDATE())&lt;/span&gt;" in that it really gives you nothing more that &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;GETDATE()&lt;/b&gt;&lt;/span&gt; anyway. The result would give you, supposing that today might be August 10th, 2010 at 11:47:01 AM, August 9th, 2010 at 11:47:01AM through August 10th, 2010 at 11:47:01 AM. In effect the results could change through the day depending upon the time you ran the query. The adopted methodology would give you an absolute definition of yesterday, or last month, eliminating the time-of-day factor, which is preferred.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-4811347129336688731?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/4811347129336688731/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=4811347129336688731' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/4811347129336688731'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/4811347129336688731'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2010/06/yesterday-working-with-dates.html' title='Yesterday... Working with Dates'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-2741333207122687532</id><published>2010-05-08T00:02:00.001-04:00</published><updated>2010-05-08T00:05:01.982-04:00</updated><title type='text'>Adapting to the ever changing drive letters...</title><content type='html'>...by using unique volume labels.&lt;br /&gt;&lt;br /&gt;Okay, this isn't a complete thought yet, just some ideas I've mulled over and found a solution for for myself, but feel free to adapt and play with it. The reason I came up with this is because I picked up a new toy, a pogoplug (v2) and it provides me with network attached storage of multiple USB Drives (External Hard Disks or USB Keys). That's great, and it also provides for the automated backup of files/folders on my PC to the device, so why would I want to control it any further? &lt;br /&gt;&lt;br /&gt;Because I can. The drive letters can change from time to time, depending on the timing of this or that being able to adapt to the changing drive letter seemed like a good idea. So, I fired up Notepad++ and wrote myself a VBScript tool that can do a bunch of things, but in this instance it can locate the drive letter for the volume name and I can parse that using CScript (command-line VBScript, vs. WScript, which would run graphical). Now I first ran cscript //H:CScript to ensure that it runs like a "DOS App" but you could easily change the batch file portion of this to simply run this in cscript. The follwing is the VBScript:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;Option Explicit&lt;br /&gt;' Find My Drive (ListDrives.vbs)&lt;br /&gt;&lt;br /&gt;DIM strVolume, strFound, objDictionary, objWMIService, colDisks, objDisk, strComputer&lt;br /&gt;DIM flagHideList, strDrive, wshShell, wshSystemEnv, wshCurrentEnv, strSetVar&lt;br /&gt;DIM i&lt;br /&gt;&lt;br /&gt;flagHideList=false&lt;br /&gt;strFound=""&lt;br /&gt;strVolume=""&lt;br /&gt;strComputer = "."&lt;br /&gt;&lt;br /&gt;Set wshShell = CreateObject( "WScript.Shell" )&lt;br /&gt;Set wshCurrentEnv = wshShell.Environment( "VOLATILE" ) ' PROCESS, SYSTEM, USER and VOLATILE&lt;br /&gt;Set objDictionary = CreateObject("Scripting.Dictionary")&lt;br /&gt;Set objWMIService = GetObject("winmgmts:\\" &amp;amp; strComputer &amp;amp; "\root\cimv2")&lt;br /&gt;&lt;br /&gt;If Wscript.Arguments.Count = 0 Then&lt;br /&gt;    ' Do Proceed as Normal&lt;br /&gt;Else&lt;br /&gt;    For i = 0 to Wscript.Arguments.Count - 1&lt;br /&gt;  If lcase(Wscript.Arguments(i)) = "/volume" Then&lt;br /&gt;            if i+1 &amp;lt;= Wscript.Arguments.Count then&lt;br /&gt;    strVolume=Wscript.Arguments(i+1)&lt;br /&gt;   end if&lt;br /&gt;  end if&lt;br /&gt;  If lcase(Wscript.Arguments(i)) = "/setvar" Then&lt;br /&gt;            if i+1 &amp;lt;= Wscript.Arguments.Count then&lt;br /&gt;    strSetVar=Wscript.Arguments(i+1)&lt;br /&gt;   end if&lt;br /&gt;  end if&lt;br /&gt;  If lcase(Wscript.Arguments(i)) = "/hidelist" Then&lt;br /&gt;   flagHideList=true&lt;br /&gt;  end if&lt;br /&gt; next&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;Set colDisks = objWMIService.ExecQuery("Select * from Win32_LogicalDisk")&lt;br /&gt;&lt;br /&gt;For Each objDisk in colDisks&lt;br /&gt;    objDictionary.Add objDisk.DeviceID, objDisk.VolumeName&lt;br /&gt; if NOT flagHideList then WScript.Echo objDisk.DeviceID &amp;amp; " " &amp;amp; objDisk.VolumeName&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;For i = 67 to 90&lt;br /&gt;    strDrive = Chr(i) &amp;amp; ":"&lt;br /&gt;    If objDictionary.Exists(strDrive) Then&lt;br /&gt;  if strVolume=ObjDictionary.Item(strDrive) then strFound=Chr(i) &amp;amp; ":"&lt;br /&gt;    End If&lt;br /&gt;Next&lt;br /&gt;if strFound&amp;lt;&amp;gt;"" then&lt;br /&gt; WScript.Echo strVolume &amp;amp; "=" &amp;amp; strFound&lt;br /&gt; if strSetVar&amp;lt;&amp;gt;"" then&lt;br /&gt;  ' Display the current value&lt;br /&gt;  WScript.Echo strSetVar &amp;amp; "=" &amp;amp; wshCurrentEnv( strSetVar )&lt;br /&gt;  ' Set the environment variable&lt;br /&gt;  wshCurrentEnv( strSetVar ) = strFound&lt;br /&gt;  WScript.Echo strSetVar &amp;amp; "=" &amp;amp; wshCurrentEnv( strSetVar )&lt;br /&gt; end if&lt;br /&gt;end if&lt;br /&gt;WScript.Quit 0&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;...and yes, this could be enhanced and/or streamlined.&lt;br /&gt;&lt;br /&gt;So. To find a Volume name "Tom's Drive" you would type:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;ListDrives.vbs /volume "Tom's Drive"&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;Now that's cute, but useless beyond yourself... what you can do is automate it... throw this into a batch file:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;FOR /F "usebackq tokens=1,2 skip=3 delims==" %%i IN (`ListDrives.vbs /volume "Tom's Drive" /hidelist`) DO SET DL=%%j &lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;b&gt;or&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;FOR /F "usebackq tokens=1,2 skip=3 delims==" %%i IN (`cscript ListDrives.vbs /volume "Tom's Drive" /hidelist`) DO SET DL=%%j &lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;You can now use the environment variable %DL% as the drive letter. You can use this dealing with All sorts of USB Keys, or even a memory card. There are other tricks too, but this was just an idea.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-2741333207122687532?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/2741333207122687532/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=2741333207122687532' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/2741333207122687532'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/2741333207122687532'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2010/05/adapting-to-ever-changing-drive-letters.html' title='Adapting to the ever changing drive letters...'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-7500129860875343318</id><published>2010-04-06T13:19:00.003-04:00</published><updated>2010-04-23T10:06:01.788-04:00</updated><title type='text'>Using T-SQL to Decode a Decimal (BIGINT) IP Address</title><content type='html'>A site I ran across stored an IP Address as a  BIGINT decimal number, to reveal the more friendly IP Address use either  of the following methods to extract the octets or the Friendly IP.  These formulae will allow you to return the IP Address in a usable  manner.&lt;br /&gt;&lt;br /&gt;&lt;table class="confluenceTable"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;th class="confluenceTh"&gt;IPAddress &lt;/th&gt; &lt;th class="confluenceTh"&gt;IPOCTET1 &lt;/th&gt; &lt;th class="confluenceTh"&gt;IPOCTET2 &lt;/th&gt; &lt;th class="confluenceTh"&gt;IPOCTET3 &lt;/th&gt; &lt;th class="confluenceTh"&gt;IPOCTET4 &lt;/th&gt; &lt;th class="confluenceTh"&gt;IPAddressEX&lt;/th&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td class="confluenceTd"&gt;2886730061 &lt;/td&gt; &lt;td class="confluenceTd"&gt;172 &lt;/td&gt; &lt;td class="confluenceTd"&gt;16 &lt;/td&gt; &lt;td class="confluenceTd"&gt;1 &lt;/td&gt; &lt;td class="confluenceTd"&gt;77 &lt;/td&gt; &lt;td class="confluenceTd"&gt;172.16.1.77&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td class="confluenceTd"&gt;2886730059 &lt;/td&gt; &lt;td class="confluenceTd"&gt;172 &lt;/td&gt; &lt;td class="confluenceTd"&gt;16 &lt;/td&gt; &lt;td class="confluenceTd"&gt;1 &lt;/td&gt; &lt;td class="confluenceTd"&gt;75 &lt;/td&gt; &lt;td class="confluenceTd"&gt;172.16.1.75&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td class="confluenceTd"&gt;2886730053 &lt;/td&gt; &lt;td class="confluenceTd"&gt;172 &lt;/td&gt; &lt;td class="confluenceTd"&gt;16 &lt;/td&gt; &lt;td class="confluenceTd"&gt;1 &lt;/td&gt; &lt;td class="confluenceTd"&gt;69 &lt;/td&gt; &lt;td class="confluenceTd"&gt;172.16.1.69&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td class="confluenceTd"&gt;2886730046 &lt;/td&gt; &lt;td class="confluenceTd"&gt;172 &lt;/td&gt; &lt;td class="confluenceTd"&gt;16 &lt;/td&gt; &lt;td class="confluenceTd"&gt;1 &lt;/td&gt; &lt;td class="confluenceTd"&gt;62 &lt;/td&gt; &lt;td class="confluenceTd"&gt;172.16.1.62&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td class="confluenceTd"&gt;2886730047 &lt;/td&gt; &lt;td class="confluenceTd"&gt;172 &lt;/td&gt; &lt;td class="confluenceTd"&gt;16 &lt;/td&gt; &lt;td class="confluenceTd"&gt;1 &lt;/td&gt; &lt;td class="confluenceTd"&gt;63 &lt;/td&gt; &lt;td cljavascript:void(0)ass="confluenceTd"&gt;172.16.1.63&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td class="confluenceTd"&gt;2886730303 &lt;/td&gt; &lt;td class="confluenceTd"&gt;172 &lt;/td&gt; &lt;td class="confluenceTd"&gt;16 &lt;/td&gt; &lt;td class="confluenceTd"&gt;2 &lt;/td&gt; &lt;td class="confluenceTd"&gt;63 &lt;/td&gt; &lt;td class="confluenceTd"&gt;172.16.2.63&lt;/td&gt; &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="preformatted"&gt;&lt;div class="preformattedContent"&gt;&lt;pre&gt;,[IPAddress]&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;b&gt;You can use:&lt;/b&gt;&lt;br /&gt;&lt;div class="preformatted"&gt;&lt;div class="preformattedContent"&gt;&lt;pre&gt;&lt;blockquote&gt;,&lt;br /&gt;   CAST(&lt;br /&gt;  CAST([IPAddress]/POWER(256,3) AS BIGINT)&lt;br /&gt;  AS VARCHAR(3)&lt;br /&gt;   ) AS IPOCTET1&lt;br /&gt;   ,&lt;br /&gt;   CAST(&lt;br /&gt;    CAST(&lt;br /&gt;   CAST(&lt;br /&gt;    [IPAddress]-CAST([IPAddress]/POWER(256,3) AS BIGINT)*POWER(256,3)&lt;br /&gt;    AS BIGINT)/POWER(256,2) AS BIGINT)&lt;br /&gt;    AS VARCHAR(3)) AS IPOCTET2&lt;br /&gt;   ,&lt;br /&gt;   CAST(&lt;br /&gt;    CAST(&lt;br /&gt;   CAST([IPAddress]&lt;br /&gt;    -CAST([IPAddress]/POWER(256,3) AS BIGINT)*POWER(256,3)&lt;br /&gt;    -CAST(CAST([IPAddress]-CAST([IPAddress]/POWER(256,3) AS BIGINT)*POWER(256,3)&lt;br /&gt;    AS BIGINT)/POWER(256,2) AS BIGINT)*POWER(256,2) AS INTEGER)/256 AS INTEGER)  &lt;br /&gt;  AS VARCHAR(3)) AS IPOCTET3&lt;br /&gt;   ,&lt;br /&gt;   CAST(&lt;br /&gt;  [IPAddress]-&lt;br /&gt;  (CAST([IPAddress]/POWER(256,3) AS BIGINT)*POWER(256,3)+&lt;br /&gt;        CAST(CAST([IPAddress]-CAST([IPAddress]/POWER(256,3) AS BIGINT)*POWER(256,3) AS BIGINT)/POWER(256,2) AS BIGINT)*POWER(256,2)+&lt;br /&gt;  CAST(&lt;br /&gt;   CAST(&lt;br /&gt;    [IPAddress]&lt;br /&gt;    -CAST([IPAddress]/POWER(256,3) AS BIGINT)*POWER(256,3)&lt;br /&gt;    -CAST(CAST([IPAddress]-CAST([IPAddress]/POWER(256,3) AS BIGINT)*POWER(256,3)&lt;br /&gt;    AS BIGINT)/POWER(256,2) AS BIGINT)*POWER(256,2) AS BIGINT)/256 AS BIGINT)*256)&lt;br /&gt;   AS VARCHAR(3)) AS IPOCTET4&lt;br /&gt;&lt;/blockquote&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;or use this to build a properly concatenated string.&lt;br /&gt;&lt;div class="preformatted"&gt;&lt;div class="preformattedContent"&gt;&lt;pre&gt;&lt;blockquote&gt;,  &lt;br /&gt;   CAST(&lt;br /&gt;  CAST([IPAddress]/POWER(256,3) AS BIGINT)&lt;br /&gt;  AS VARCHAR(3)&lt;br /&gt;   ) + '.' +&lt;br /&gt;   CAST(&lt;br /&gt;    CAST(&lt;br /&gt;   CAST(&lt;br /&gt;    [IPAddress]-CAST([IPAddress]/POWER(256,3) AS BIGINT)*POWER(256,3)&lt;br /&gt;    AS BIGINT)/POWER(256,2) AS BIGINT)&lt;br /&gt;    AS VARCHAR(3)) + '.' +&lt;br /&gt;   CAST(&lt;br /&gt;    CAST(&lt;br /&gt;   CAST([IPAddress]&lt;br /&gt;    -CAST([IPAddress]/POWER(256,3) AS BIGINT)*POWER(256,3)&lt;br /&gt;    -CAST(CAST([IPAddress]-CAST([IPAddress]/POWER(256,3) AS BIGINT)*POWER(256,3)&lt;br /&gt;    AS BIGINT)/POWER(256,2) AS BIGINT)*POWER(256,2) AS INTEGER)/256 AS INTEGER)  &lt;br /&gt;  AS VARCHAR(3)) + '.' +&lt;br /&gt;   CAST(&lt;br /&gt;  [IPAddress]-&lt;br /&gt;  (CAST([IPAddress]/POWER(256,3) AS BIGINT)*POWER(256,3)+&lt;br /&gt;        CAST(CAST([IPAddress]-CAST([IPAddress]/POWER(256,3) AS BIGINT)*POWER(256,3) AS BIGINT)/POWER(256,2) AS BIGINT)*POWER(256,2)+&lt;br /&gt;  CAST(&lt;br /&gt;   CAST(&lt;br /&gt;    [IPAddress]&lt;br /&gt;    -CAST([IPAddress]/POWER(256,3) AS BIGINT)*POWER(256,3)&lt;br /&gt;    -CAST(CAST([IPAddress]-CAST([IPAddress]/POWER(256,3) AS BIGINT)*POWER(256,3)&lt;br /&gt;    AS BIGINT)/POWER(256,2) AS BIGINT)*POWER(256,2) AS BIGINT)/256 AS BIGINT)*256)&lt;br /&gt;   AS VARCHAR(3)) AS IPAddressEX&lt;br /&gt;&lt;/blockquote&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;...and Back&lt;br /&gt;&lt;br /&gt;To find a printer, in this example by searching for one in SQL, that IP Address might seem fairly useless looking at the numbers involved. You could calculate it yourself by taking the Octets of the IP Address and using this formula:&lt;br /&gt;&lt;blockquote&gt;16777216*Octet1 + 65536*Octet2 + 256*Octet3 + Octet4 &lt;/blockquote&gt;...but we like automation.&lt;br /&gt;&lt;br /&gt;&lt;div class="preformatted"&gt;&lt;div class="preformattedContent"&gt;&lt;pre&gt;&lt;blockquote&gt;DECLARE @IPAddr varchar(16);&lt;br /&gt;DECLARE @IPAddrAsDecimal BIGINT;&lt;br /&gt;DECLARE @IPAddrOctet1 BIGINT;&lt;br /&gt;DECLARE @IPAddrOctet2 BIGINT;&lt;br /&gt;DECLARE @IPAddrOctet3 BIGINT;&lt;br /&gt;DECLARE @IPAddrOctet4 BIGINT;&lt;br /&gt;DECLARE @intStartPos INT;&lt;br /&gt;DECLARE @intEndPoint INT&lt;br /&gt;&lt;br /&gt;SET @IPAddr='10.176.24.138';&lt;br /&gt;--SET @IPAddr='172.16.2.66';&lt;br /&gt;&lt;br /&gt;SELECT @IPAddrOctet1=CONVERT(BIGINT, LEFT(@IPAddr,CHARINDEX('.', @IPAddr)-1));&lt;br /&gt;&lt;br /&gt;SELECT @intStartPos=(LEN(@IPAddrOctet1)+2);&lt;br /&gt;SELECT @intEndPoint=CHARINDEX('.', @IPAddr, @intStartPos);&lt;br /&gt;SELECT @IPAddrOctet2=CONVERT(BIGINT, SUBSTRING(@IPAddr,@intStartPos,@intEndPoint-@intStartPos));&lt;br /&gt;&lt;br /&gt;SELECT @intStartPos=(LEN(@IPAddrOctet1)+LEN(@IPAddrOctet2)+3);&lt;br /&gt;SELECT @intEndPoint=CHARINDEX('.', @IPAddr, @intStartPos);&lt;br /&gt;SELECT @IPAddrOctet3=CONVERT(BIGINT, SUBSTRING(@IPAddr,@intStartPos,@intEndPoint-@intStartPos));&lt;br /&gt;&lt;br /&gt;SELECT @intStartPos=(LEN(@IPAddrOctet1)+LEN(@IPAddrOctet2)+LEN(@IPAddrOctet3)+4);&lt;br /&gt;SELECT @intEndPoint=LEN(@IPAddr);&lt;br /&gt;SELECT @IPAddrOctet4=CONVERT(BIGINT, RIGHT(@IPAddr,@intEndPoint-@intStartPos+1));&lt;br /&gt;&lt;br /&gt;SELECT @IPAddrOctet1 as Octet1, @IPAddrOctet2 as Octet2, @IPAddrOctet3 as Octet3, @IPAddrOctet4 as Octet4&lt;br /&gt;&lt;br /&gt;SELECT @IPAddrAsDecimal=16777216*@IPAddrOctet1 + 65536*@IPAddrOctet2 + 256*@IPAddrOctet3 + @IPAddrOctet4;&lt;br /&gt;&lt;br /&gt;SELECT @IPAddrAsDecimal as IPAddressAsDecimal;&lt;br /&gt;&lt;br /&gt;--/* &lt;br /&gt;&lt;br /&gt;SELECT [IPAddress]&lt;br /&gt;      ,[PrinterName]&lt;br /&gt;      ,[PModelID]&lt;br /&gt;      ,[SiteID]&lt;br /&gt;      ,[MAC]&lt;br /&gt;      ,[Location]&lt;br /&gt;      ,[Approved]&lt;br /&gt;      ,[Hits]&lt;br /&gt;      ,[Agent]&lt;br /&gt;      ,[TouchDate]&lt;br /&gt;  FROM [oad].[dbo].[PrinterList]&lt;br /&gt;WHERE IPAddress = @IPAddrAsDecimal&lt;br /&gt;;&lt;br /&gt;--*/&lt;br /&gt;&lt;/blockquote&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-7500129860875343318?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/7500129860875343318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=7500129860875343318' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/7500129860875343318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/7500129860875343318'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2010/04/site-i-ran-across-stored-ip-address-as.html' title='Using T-SQL to Decode a Decimal (BIGINT) IP Address'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-6071438521827800654</id><published>2009-08-16T15:04:00.003-04:00</published><updated>2009-08-16T15:25:01.006-04:00</updated><title type='text'>Backing up 'My Pictures'</title><content type='html'>I use Picasa to manage my pictures, all of them. The problem I have and a preference is that while I keep some of them on my laptop, which is backed up weekly, I'd like the bulk of them archived to my external drives. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The following is a batch file (.CMD) that will archive my files from my laptop to my "T:" drive, then back up that collection, complete to my "G:" drive. It also tries to process the Picasa Album databases, but I'm not sure this is working ideally yet. When running this batch file ensure Picasa is not running, and relax.&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;@echo off&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;CLS&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;SET backupDest1=T:\Archive of My Pictures&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;SET backupDest2=G:\Backup of My Pictures&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;TITLE Backup Up Picasa Album Settings...&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;FOR /F "tokens=1,2,3,4,5 delims=/ " %%a in ('date /T') do SET backupDate=%%c%%b%%a&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;PUSHD "%USERPROFILE%\Local Settings\Application Data\Google\Picasa2Albums\"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;IF NOT EXIST "%backupDest1%" MKDIR "%backupDest1%"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;IF NOT EXIST "%backupDest1%\_AlbumInfo" MKDIR "%backupDest1%\_AlbumInfo"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;IF NOT EXIST "%backupDest1%\_AlbumInfo\%backupDate%" MKDIR "%backupDest1%\_AlbumInfo\%backupDate%"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;robocopy backup "%backupDest1%\_AlbumInfo\backup" *.* /XO /S /E /ETA /V /R:3 /W:3&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;robocopy . "%backupDest1%\_AlbumInfo\%backupDate%" *.* /XO /XD backup /S /E /ETA /V /R:3 /W:3&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;TITLE Updating Album File Locations...&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;FOR /F "tokens=1,2,3,4,5 delims=:" %%a in ('echo %backupDest1%') do SET myPicsUpdate=[%%a]%%b&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;FOR /F %%a in ('dir /b /a:d-h "%backupDest1%\_AlbumInfo\%backupDate%\"') do call :cmpAInfo "%backupDest1%\_AlbumInfo\%backupDate%\%%a"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;TITLE Clearing My Pictures...&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;robocopy "%USERPROFILE%\My Documents\My Pictures" "%backupDest1%" /S /E /ETA /MOVE /R:3 /W:3&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;TITLE Backing up %backupDest1% to %backupDest2%...&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;robocopy "%backupDest1%" "%backupDest2%" /XO /S /E /ETA /V /R:3 /W:3&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;TITLE Update Active Albums...&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;robocopy "%backupDest1%\_AlbumInfo\%backupDate%" . *.* /XO /XD backup /S /E /ETA /V /R:3 /W:3&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;if NOT EXIST "%USERPROFILE%\My Documents\My Pictures" MKDIR "%USERPROFILE%\My Documents\My Pictures"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;popd&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;goto :eof&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;pause&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;TITLE Command Prompt&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;goto :eof&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;:cmpAInfo&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;echo Processing %~1...&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;REM FOR /F %%a in ('dir /b "%~1"') do echo "%~1\%%a"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;FOR /F %%a in ('dir /b /a:-d "%~1"') do gsar -i -o -s"$My Pictures" -r"%myPicsUpdate%" "%~1\%%a"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;goto :eof&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now... you'll need to verify your date format at the command prompt, mine is DD/MM/YYYY the line that sets the backupDate may need to be tweaked. Of course the two destination variables need to be set appropriately for your own needs. Have fun... but play it safe test this for yourself first.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://gnuwin32.sourceforge.net/packages/gsar.htm"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;gsar.exe&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;   - Global Search and Replace&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;a href="http://en.wikipedia.org/wiki/Robocopy"&gt;robocopy&lt;/a&gt;   - Microsoft's Robocopy&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new', serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new', serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-6071438521827800654?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/6071438521827800654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=6071438521827800654' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/6071438521827800654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/6071438521827800654'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2009/08/backing-up-my-pictures.html' title='Backing up &apos;My Pictures&apos;'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-2155868446536494605</id><published>2009-07-26T09:17:00.003-04:00</published><updated>2009-07-26T11:09:00.186-04:00</updated><title type='text'>Tired of loading that HP Photo and Imaging Director?</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://lh4.ggpht.com/_TJeEEkIrus8/SmxinbkSZPI/AAAAAAAAGDc/-a7qJieLOgo/Processes%2026072009%20100350.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 466px; height: 286px;" src="http://lh4.ggpht.com/_TJeEEkIrus8/SmxinbkSZPI/AAAAAAAAGDc/-a7qJieLOgo/Processes%2026072009%20100350.jpg" border="0" alt="" /&gt;&lt;/a&gt;You can eliminate the use of this middle-man tool by creating Desktop or Quick Launch toolbar shortcuts to the actual program easily, but it takes some research. The first step is to figure out what application is being run when you click on the functions of this HP dashboard, this is done by watching your Task Manager and watching for a new image name to appear under processes. This is most likely the executable's filename so search for the imagename (i.e. hpqkygrp.exe) to find out where this file lives.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You'll need to rename imagename.exe to something else, I'd suggest _magename.exe (_pqkygrp.exe as an example) and copy &lt;a href="http://www.box.net/shared/j6e1qakeei"&gt;this program&lt;/a&gt; to the folder you found that imagename in and rename it to the original application's name.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://lh5.ggpht.com/_TJeEEkIrus8/SmxuGT7T9wI/AAAAAAAAGD8/89F3e9_cE9c/WinEcho%20Command%20line%20capture%20tool.%2026072009%20105332.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 474px; height: 222px;" src="http://lh5.ggpht.com/_TJeEEkIrus8/SmxuGT7T9wI/AAAAAAAAGD8/89F3e9_cE9c/WinEcho%20Command%20line%20capture%20tool.%2026072009%20105332.jpg" border="0" alt="" /&gt;&lt;/a&gt;Click on that HP Photo &amp;amp; Imaging Director button again, this will open a &lt;a href="http://lh5.ggpht.com/_TJeEEkIrus8/SmxuGT7T9wI/AAAAAAAAGD8/89F3e9_cE9c/WinEcho%20Command%20line%20capture%20tool.%2026072009%20105332.jpg"&gt;dialog&lt;/a&gt; with the complete command line, copy this command line and create a shortcut in either your Quick Launch toolbar, or on the desktop.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Repeat this process for each of the buttons in this launcer application. It may work for other applications too, but this was my own challenge and I figured I'd share it with you.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Remember to rename the program back to what it was called originally, and keep WinEcho.exe for the next time you need it.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-2155868446536494605?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/2155868446536494605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=2155868446536494605' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/2155868446536494605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/2155868446536494605'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2009/07/tired-of-loading-that-hp-photo-and.html' title='Tired of loading that HP Photo and Imaging Director?'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_TJeEEkIrus8/SmxinbkSZPI/AAAAAAAAGDc/-a7qJieLOgo/s72-c/Processes%2026072009%20100350.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-864989251214019807</id><published>2009-04-01T04:06:00.003-04:00</published><updated>2009-04-01T04:33:17.141-04:00</updated><title type='text'>PHP error_reporting Code/Cypher</title><content type='html'>When developing code, a web site, in PHP it's handy to turn on some of the error_reporting functionality during debugging. To determin the correct code(s) to use try this simple &lt;a href="http://spreadsheets.google.com/ccc?key=pY4etJ63Njsvwr_zZ_QnzBg"&gt;Google Docs spreadsheet&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The principle is best &lt;a href="http://ca.php.net/error_reporting"&gt;explained in the PHP manual&lt;/a&gt; (available online and &lt;a href="http://www.google.com/search?hl=en&amp;amp;rlz=1Q1ACAW_enCA320CA320&amp;amp;q=PHP+error_reporting+manual&amp;amp;btnG=Search"&gt;only a Google away&lt;/a&gt;), but this may help you understand what's being enabled and disabled and with the code required.&lt;br /&gt;&lt;br /&gt;Examples (Lifted from the manual for your understanding):&lt;br /&gt;&lt;div class="example-contents programlisting"&gt; &lt;div class="phpcode"&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;span style="color: rgb(0, 0, 187);"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;// Turn off all error reporting&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;error_reporting&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;// Report simple running errors&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;error_reporting&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;E_ERROR &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;| &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;E_WARNING &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;| &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;E_PARSE&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;// Reporting E_NOTICE can be good too (to report uninitialized&lt;br /&gt;// variables or catch variable name misspellings ...)&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;error_reporting&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;E_ERROR &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;| &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;E_WARNING &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;| &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;E_PARSE &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;| &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;E_NOTICE&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;// Report all errors except E_NOTICE&lt;br /&gt;// This is the default value set in php.ini&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;error_reporting&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;E_ALL &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;^ &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;E_NOTICE&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;// Report all PHP errors&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;error_reporting&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;E_ALL&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;// Same as error_reporting(E_ALL);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;ini_set&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'error_reporting'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;E_ALL&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;&lt;/span&gt; &lt;/span&gt; &lt;/code&gt;&lt;/div&gt;     &lt;/div&gt;&lt;a href="http://php.net/"&gt;PHP&lt;/a&gt; is one of the most powerful languages out there for web development, frankly there's not much it can't do when you add the right classes (which is like a DLL or Component on the ASP side) but the advantage is the cost... ZERO. If you want a development environment for your own personal machine, try out &lt;a href="http://www.virtualbox.org/"&gt;VirtualBox&lt;/a&gt; or &lt;a href="http://www.vmware.com/products/server/"&gt;VMWare Server&lt;/a&gt; and build one (Ubuntu or Ubuntu Server are great platforms, though OpenBSD, Debian, Fedora and the like are also popular and just as worthy). VMWare's VMTN has ready-to-use VMs you can simply plug in and fire up. I might pre-fab a couple of installations for VirtualBox over the next little while, no promises but if you're stuck let me know and I'll do what I can.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-864989251214019807?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/864989251214019807/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=864989251214019807' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/864989251214019807'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/864989251214019807'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2009/04/php-errorreporting-codecypher.html' title='PHP error_reporting Code/Cypher'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-5477133274441864949</id><published>2008-07-03T16:06:00.000-04:00</published><updated>2008-07-03T16:06:24.471-04:00</updated><title type='text'>TiddlyWiki - a reusable non-linear personal web notebook</title><content type='html'>This is NOT my technical trick, but definately worth a gander. Excellent work by Jeremy and the TiddlyWiki contributors!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.tiddlywiki.com/"&gt;&lt;/a&gt;&lt;blockquote&gt;&lt;a href="http://www.tiddlywiki.com/"&gt;TiddlyWiki - a reusable non-linear personal web notebook&lt;/a&gt;: "TiddlyWiki, a popular free MicroContent WikiWikiWeb created by JeremyRuston and a busy Community of independent developers. It's written in HTML, CSS and JavaScript to run on any modern browser without needing any ServerSide logic. It allows anyone to create personal SelfContained hypertext documents that can be posted to a WebServer, sent by email or kept on a USB thumb drive to make a WikiOnAStick."&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-5477133274441864949?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.tiddlywiki.com/' title='TiddlyWiki - a reusable non-linear personal web notebook'/><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/5477133274441864949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=5477133274441864949' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/5477133274441864949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/5477133274441864949'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2008/07/tiddlywiki-reusable-non-linear-personal.html' title='TiddlyWiki - a reusable non-linear personal web notebook'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-5924629929649870624</id><published>2008-03-19T11:09:00.003-04:00</published><updated>2008-06-17T16:05:05.612-04:00</updated><title type='text'>Simplifying Rollouts: Server-Sensitive Code</title><content type='html'>I maintain a Linux/Apache/MySQL/PHP site as part of my role and keeping the sites sync and problem free between Development, Stage, and Production can be a little tricky if you've got things to worry about like outbound e-mails, scheduled jobs, and credit card clearing that you really do NOT want going awry when it hits production.&lt;br /&gt;&lt;br /&gt;There are many method of detecting which manner of operation your various sites have, the simplest of which is a variable that states the mode in a common file. This one file can become a hazard because you need to remember not to sync that file to the production server.&lt;br /&gt;&lt;br /&gt;I was looking for a manner by which to determine which server the code was executing on with a high-degree of reliability and this seems to work. I created the function called 'serverIPAddress()' which returns the obvious, but it's the how that is interesting. I must say, I am unsure whether this will work 100% for all of you as-is, as there many be slight differences in the output of the Linux command 'ifconfig' that need to be accounted for. In my implementation there are but two adapters, local (lo) and Ethernet (eth0), eth0 is listed first and I'm not sure this can change but I'll accept that it could. So, that said... the output of &lt;span style="font-style: italic;font-family:courier new;" &gt;ifconfig&lt;/span&gt; looks like this:&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;eth0      Link encap:Ethernet  HWaddr 00:0C:29:41:18:C4&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;          inet6 addr: fe80::20c:29ff:fe41:18c4/64 Scope:Link&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;          RX packets:26995 errors:0 dropped:0 overruns:0 frame:0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;          TX packets:20748 errors:0 dropped:0 overruns:0 carrier:0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;          collisions:0 txqueuelen:1000&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;          RX bytes:3324252 (3.1 MiB)  TX bytes:6947293 (6.6 MiB)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;          Interrupt:177 Base address:0x1400&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;lo        Link encap:Local Loopback&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;          inet addr:127.0.0.1  Mask:255.0.0.0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;          inet6 addr: ::1/128 Scope:Host&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;          UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;          RX packets:0 errors:0 dropped:0 overruns:0 frame:0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;          collisions:0 txqueuelen:0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;/span&gt;The code to extract the 'inet addr' from this response looks like this:&lt;br /&gt;&lt;blockquote  style="font-family:courier new;"&gt;function serverIpAddress(){&lt;br /&gt;exec("&lt;span style="color: rgb(204, 0, 0);"&gt;/sbin/ifconfig&lt;/span&gt;",$ifconfig);&lt;br /&gt;$target=explode("  ",$ifconfig[1]);&lt;br /&gt;$bustoutip=explode(":",$target[5]);&lt;br /&gt;$serverIP=$bustoutip[1];&lt;br /&gt;return $serverIP;&lt;br /&gt;}&lt;/blockquote&gt;The path for ifconfig is explicit due my use of this in a host of scheduled tasks (&lt;span style="font-style: italic;"&gt;cron jobs&lt;/span&gt;) on the server. I'll be apply in this to my web site as well as the method for detection is based on 'SERVER_NAME' and a little less reliable/safe in my books.&lt;br /&gt;&lt;br /&gt;Once I have the IP Address I can move on to making server specific code that understands what to do dependant upon the server that it is executing on. The following code takes the resulting IP Address and sets variables, etc. to ensure that code transitioned from development to stage/production can understand and behave reliably. There's nothing worse during service recovery when there are code differences, especially if the code differences are not well documented.&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;switch(serverIPAddress()){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    case '192.168.1.3': // PRODUCTION&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;        $enable_say = 1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        define( "DEBUG", false);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        $SMTPSmartHost = "192.168.1.7"; // Kerio Server&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        define("K_ServerMode","P");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    break;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;case '192.168.1.9': // STAGE&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;        $enable_say = 1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        define( "DEBUG", false);  //DEV&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        $SMTPSmartHost = "192.168.1.2"; // Cameron's DEV VM&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        define("K_ServerMode","S");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    break;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;case '192.168.1.45': // DEV&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    default:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;        $enable_say = 1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        define( "DEBUG", true);  //DEV&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        $SMTPSmartHost = "192.168.1.2"; // Cameron's DEV VM&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;define("K_ServerMode","D");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    break;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-5924629929649870624?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/5924629929649870624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=5924629929649870624' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/5924629929649870624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/5924629929649870624'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2008/03/simplifying-rollouts-server-sensitive.html' title='Simplifying Rollouts: Server-Sensitive Code'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-408794588006491672</id><published>2007-05-16T14:03:00.000-04:00</published><updated>2007-05-16T14:58:29.678-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='FTP'/><category scheme='http://www.blogger.com/atom/ns#' term='CMD'/><category scheme='http://www.blogger.com/atom/ns#' term='batch'/><category scheme='http://www.blogger.com/atom/ns#' term='scripting'/><title type='text'>FTP a file and rename it to today's date.</title><content type='html'>This isn't difficult, but it can be useful. This routine will grab a file (one or more actually but be careful) and rename the received file to today's date. You could go further and exercise the %TIME% variable, but that's up to you.&lt;br /&gt;&lt;br /&gt;getfile.cmd:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;@echo off&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;if exist &lt;span style="font-style: italic; font-weight: bold; color: rgb(0, 0, 153);"&gt;dlfilespec&lt;/span&gt; del /f /q &lt;span style="font-style: italic; font-weight: bold; color: rgb(0, 0, 153);"&gt;dlfilespec&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;ftp -s:getfile.ftp -v&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;if exist &lt;span style="font-weight: bold; color: rgb(0, 0, 153); font-style: italic;"&gt;destfilespec&lt;/span&gt;_%DATE:~6,4%%DATE:~3,2%%DATE:~0,2%.zip&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt; &lt;span style="color: rgb(0, 153, 0);"&gt;~SPLIT~&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;del /f /q &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153); font-style: italic;"&gt;destfilespec&lt;/span&gt;_%DATE:~6,4%%DATE:~3,2%%DATE:~0,2%.zip&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;ren &lt;span style="font-style: italic; font-weight: bold; color: rgb(0, 0, 153);"&gt;dlfilespec&lt;/span&gt; &lt;span style="color: rgb(0, 153, 0);"&gt;~SPLIT~&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold; font-style: italic;font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;destfilespec&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;_%DATE:~6,4%%DATE:~3,2%%DATE:~0,2%.zip&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;getfile.ftp:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;open &lt;span style="font-style: italic; font-weight: bold;"&gt;host&lt;/span&gt;  &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(204, 0, 0);font-family:courier new;" &gt;username&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(204, 0, 0);font-family:courier new;" &gt;password&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;binary&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;prompt&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;mget &lt;span style="font-weight: bold; font-style: italic; color: rgb(0, 0, 153);"&gt;dlfilespec&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;ls&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;close&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;bye&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-408794588006491672?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/408794588006491672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=408794588006491672' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/408794588006491672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/408794588006491672'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2007/05/ftp-file-and-rename-it-to-todays-date.html' title='FTP a file and rename it to today&apos;s date.'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-6461023838850418341</id><published>2007-05-04T12:54:00.000-04:00</published><updated>2007-05-04T13:03:53.996-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CMD'/><category scheme='http://www.blogger.com/atom/ns#' term='batch'/><title type='text'>Alerting when a process is a memory pig...</title><content type='html'>Now this example uses &lt;span style="color: rgb(0, 102, 0);"&gt;putty.exe&lt;/span&gt; right now, but the original purpose was to alert when a jrun.exe was getting too big for it's britches. Run as a scheduled task (AT job) and customize to suit:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;&lt;span style="font-size:85%;"&gt;@echo off&lt;br /&gt;for /F "usebackq tokens=1,2,3,4,5,6 delims=, " %%a IN (`tasklist /NH /FI "imagename eq &lt;span style="color: rgb(0, 102, 0); font-weight: bold;"&gt;putty.exe&lt;/span&gt;"`) do CALL :CHECKMU %%e%%f&lt;br /&gt;goto :eof&lt;br /&gt;&lt;br /&gt;:CHECKMU&lt;br /&gt;SET /A MEMUSAGE=0+%~1&lt;br /&gt;IF /I %MEMUSAGE% GTR &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;1400&lt;/span&gt; echo Memory Usage Warning: %MEMUSAGE%&lt;br /&gt;&lt;br /&gt;GOTO :eof&lt;/span&gt;&lt;/blockquote&gt; The &lt;span style="font-style: italic;"&gt;echo&lt;/span&gt; for 'Memory Usage Warning' will only execute if the memory usage exceeds &lt;span style="color: rgb(255, 0, 0);"&gt;1400&lt;/span&gt; (in this example) This could be a call, note the use of subroutines in the batch file (CHECKMU). If there are many processes running the PID could be passed using other variables (%%a, %%b, etc.) but it will execute for each instance that meets the criteria.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-6461023838850418341?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/6461023838850418341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=6461023838850418341' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/6461023838850418341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/6461023838850418341'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2007/05/alerting-when-process-is-memory-pig.html' title='Alerting when a process is a memory pig...'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-6997051150337809143</id><published>2007-01-19T09:14:00.001-05:00</published><updated>2009-03-06T03:36:42.552-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wed design'/><title type='text'>Running into The Man in Blue</title><content type='html'>I recently went hunting for information on detecting browser information using JavaScript and through no random chance, found myself reading the blog of The Man in Blue.&lt;br /&gt;&lt;br /&gt;While the information was valuable, what impressed me, and inspires me, is the design of his portfolio site. It's clean, usable, and incredibly simple. The interface is poetically enjoyable and intuitive. I would hope no one would copy this site, that would be wrong, but instead find inspiration in his design.&lt;br /&gt;&lt;br /&gt;Please have a look: &lt;a href="http://portfolio.themaninblue.com/"&gt;The Man In Blue&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-6997051150337809143?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/6997051150337809143/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=6997051150337809143' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/6997051150337809143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/6997051150337809143'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2007/01/running-into-man-in-blue.html' title='Running into The Man in Blue'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-2243995736608232402</id><published>2006-12-13T22:56:00.000-05:00</published><updated>2006-12-13T23:11:15.954-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web development'/><category scheme='http://www.blogger.com/atom/ns#' term='Code Reviews'/><category scheme='http://www.blogger.com/atom/ns#' term='RegEx'/><category scheme='http://www.blogger.com/atom/ns#' term='Regular Expressions'/><category scheme='http://www.blogger.com/atom/ns#' term='Quality'/><category scheme='http://www.blogger.com/atom/ns#' term='coding'/><title type='text'>Feeling Regular and the use of Fibre.</title><content type='html'>No, I'm feeling fine, though a tad tired.&lt;br /&gt;&lt;br /&gt;I'm finally getting around to exploring Regular Expressions (RegEx) and coming to realize the value of the beast and the simplicity of the design. I picked the brain of my friend and mentor, &lt;a href="http://www.ashleyit.com/"&gt;Brent Ashley&lt;/a&gt; today and he showed me the &lt;a href="http://weitz.de/regex-coach/"&gt;RegEx Coach&lt;/a&gt; and introduced me to some of the logic. I found more in my O'Reilly book, "&lt;a href="http://www.oreilly.com/catalog/jscript5/index.html"&gt;JavaScript: The Definative Guide&lt;/a&gt;" (I have the 3rd edition) tonight and I can say one thing about RegEx.&lt;br /&gt;&lt;br /&gt;LEARN IT! Come to understand it and you'll be SO far ahead of the game. It is far from being the ONLY thing you need to know, but it will make you that much better at doing things the right way.&lt;br /&gt;&lt;br /&gt;Now, I also asked Brent to do a code an informal code-review on a little VBScript thing I was working on. Frankly, it wasn't going well because I was just a little more rusty that I enjoy being, but I asked for the review to get an idea of where I need to improve. I found out.&lt;br /&gt;&lt;br /&gt;It's tough to hear that you're not an ace, but you NEED to hear it. Efficiency is everything in development and my design was weak. There's much more I need to learn, but his manner of showing me where I can improve was skillful and conscientious.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-2243995736608232402?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/2243995736608232402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=2243995736608232402' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/2243995736608232402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/2243995736608232402'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2006/12/feeling-regular-and-use-of-fibre.html' title='Feeling Regular and the use of Fibre.'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-7197142383086748681</id><published>2006-11-13T16:21:00.000-05:00</published><updated>2006-11-13T16:35:00.117-05:00</updated><title type='text'>Slow running Linux VM on VMWare ESX?</title><content type='html'>If your VMWare ESX implementation of a Linux guest OS is running slow... a stop-gap solution may be the following...&lt;br /&gt;&lt;br /&gt;Create a script that connects to a reliable time server and retrieves the time:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;&lt;span style="font-size:85%;"&gt;#!/bin/bash&lt;br /&gt;# Sync HWClock to timeserver.mynetwork.local&lt;br /&gt;/bin/date&lt;br /&gt;/sbin/service ntpd stop&lt;br /&gt;/usr/sbin/ntpdate 192.168.0.50&lt;br /&gt;/sbin/hwclock --systohc&lt;br /&gt;/sbin/service ntpd start&lt;br /&gt;/bin/date&lt;/span&gt;&lt;/blockquote&gt;Now, add two entries to crontab:&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: courier new;"&gt;1 */1 * * * /var/scripts/scheduled/synctime &gt;&gt; /var/log/synctime.log&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;*/2 * * * * /sbin/hwclock --hctosys&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;You can certainly adjust the times, this is set to get the real time once an "hour" at the 1. Then sync the OS from the VM hardware clock every 2 minutes.&lt;br /&gt;&lt;br /&gt;Sample output of synctime:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;&lt;span style="font-size:85%;"&gt;Mon Nov 13 16:01:01 EST 2006&lt;br /&gt;Shutting down ntpd: [  OK  ]&lt;br /&gt;13 Nov 16:04:46 ntpdate[19413]: step time server 192.168.0.50 offset 223.590418 sec&lt;br /&gt;ntpd: Synchronizing with time server: [FAILED]&lt;br /&gt;Starting ntpd: [  OK  ]&lt;br /&gt;Mon Nov 13 16:04:49 EST 2006&lt;/span&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-7197142383086748681?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/7197142383086748681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=7197142383086748681' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/7197142383086748681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/7197142383086748681'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2006/11/slow-running-linux-vm-on-vmware-esx.html' title='Slow running Linux VM on VMWare ESX?'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-5543031315642111669</id><published>2006-10-09T07:36:00.001-04:00</published><updated>2008-09-24T08:49:20.315-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='VBA'/><category scheme='http://www.blogger.com/atom/ns#' term='Excel'/><category scheme='http://www.blogger.com/atom/ns#' term='UPDATE'/><title type='text'>UPDATE Query from Excel to (My)SQL Database</title><content type='html'>Recently I found out about a problem going between versions of MySQL last week and I though you might enjoy the solution. You see FLOAT()'s functionality changed whereby FLOAT(4,2) once meant 0000.00 to now meaning 00.00. The problem with this is that database imported with a value of 2341.33 becomes 99.99! This could be very bad. Fortunately you can export from the old DB via Query Browser to Excel (XML) and employ VBA and ODBC to get things right, fast.&lt;br /&gt;&lt;br /&gt;Notably this does not update all values, only values where there is data, if you were to use this routine to post to a database repeatedly I would suggest adjusting the '&lt;span style="font-style: italic;"&gt;If ActiveCell.Value &lt;&gt; "" Then&lt;/span&gt;' functionality to set Null values as needed.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Sub UpdateDB()&lt;br /&gt;'&lt;br /&gt;' 09/10/2006 by Cameron Stevens&lt;br /&gt;'&lt;br /&gt;&lt;br /&gt;Set myconn = CreateObject("adodb.connection")&lt;br /&gt;Connection = "Driver={MySQL ODBC 3.51 Driver}; Server=MyServer; &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;          uid=webuser; pwd=b33rg00gl3s; database=brewery; option=3; port=3306;"&lt;br /&gt;myconn.Open (Connection)&lt;br /&gt;Set result = CreateObject("adodb.recordset")&lt;br /&gt;Sql = "USE brewery;"&lt;br /&gt;Set result = myconn.Execute(Sql)&lt;br /&gt;&lt;br /&gt;Range("A1").Select&lt;br /&gt;Selection.Offset(1, 0).Select&lt;br /&gt;strUpdate = "UPDATE tblBottlePrices SET "&lt;br /&gt;While ActiveCell.Value &lt;&gt; ""&lt;br /&gt;strWHERE = " WHERE order_id='" &amp;amp; ActiveCell.Value &amp;amp; "' "&lt;br /&gt;Selection.Offset(0, 4).Select&lt;br /&gt;strSET = " "&lt;br /&gt;If ActiveCell.Value &lt;&gt; "" Then strSET = strSET &amp;amp; "retail_price='" &amp;amp; ActiveCell.Value &amp;amp; "' "&lt;br /&gt;Selection.Offset(0, 1).Select&lt;br /&gt;If ActiveCell.Value &lt;&gt; "" Then strSET = strSET &amp;amp; ", discount_price='" &amp;amp; ActiveCell.Value &amp;amp; "' "&lt;br /&gt;'Selection.Offset(0, 1).Select&lt;br /&gt;&lt;br /&gt;strUQuery = strUpdate &amp;amp; strSET &amp;amp; strWHERE&lt;br /&gt;&lt;br /&gt;Set result = myconn.Execute(strUQuery)&lt;br /&gt;&lt;br /&gt;'MsgBox strUQuery&lt;br /&gt;Selection.End(xlToLeft).Select&lt;br /&gt;Selection.Offset(1, 0).Select&lt;br /&gt;Wend&lt;br /&gt;myconn.Close&lt;br /&gt;Set result = Nothing&lt;br /&gt;Set myconn = Nothing&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-5543031315642111669?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/5543031315642111669/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=5543031315642111669' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/5543031315642111669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/5543031315642111669'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2006/10/update-query-from-excel-to-mysql.html' title='UPDATE Query from Excel to (My)SQL Database'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-755919550228063479</id><published>2006-10-09T07:11:00.002-04:00</published><updated>2006-10-09T07:12:16.261-04:00</updated><title type='text'>Accessing or Deleting an Inaccessible File/Folder</title><content type='html'>While the rights may be adjusted using CACLS or the like, there are occationally files hat prove inpenitrable. It seems that the pleasantries of Long File Names can occationally curse us if that LFN gets corrupted. You can do what you want to delete the folder but it won't budge. But... there's a trick... go to a command prompt and perform a DIR /X on the folder containing this file or folder. The /X switch shows you the 8.3 or short names for these files, rename the problematic file using the short name and all is well (i.e. REN ALLDEA~2 XXX). &lt;p&gt;While this isn't the only way into a file that's inaccessible, it may be the last resort with a file that's got a corrupt filename.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-755919550228063479?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/755919550228063479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=755919550228063479' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/755919550228063479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/755919550228063479'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2006/10/accessing-or-deleting-inaccessible.html' title='Accessing or Deleting an Inaccessible File/Folder'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-8128565441032845364</id><published>2006-10-09T07:11:00.001-04:00</published><updated>2006-10-09T07:11:33.838-04:00</updated><title type='text'>3D Text Screen Saver</title><content type='html'>At one time the 3D text Screen Saver had some cool tricks that depended upon your choice of words. If you typed in 'Beer', 'Volcano', or 'rock' you had a selection of things come up in the screen saver that meant something to the developers. Windows 2000 threw this Easter Egg out, but left a treasure behind. If you're using Windows2000 you have the opportunity to inflict your personality on this screen saver. To get your own selection of words appearing you need to do the following:   &lt;ol&gt;&lt;li&gt;Open Regedit and search for the string HKEY_CURRENT_USER\Control Panel\Screen Saver.3DText&lt;/li&gt;&lt;li&gt;Create a new String Value called Magic&lt;/li&gt;&lt;li&gt;Enter a value for it which will be the name of the file you want to use (e.g. c:\winnt\magic.txt)&lt;/li&gt;&lt;li&gt;Create the file (c:\winnt\magic.txt) using notepad. The format is as follows:&lt;br /&gt;-Test&lt;br /&gt; blah&lt;br /&gt;deedum&lt;br /&gt;hello&lt;br /&gt;n00b&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;    &lt;p&gt;&lt;strong&gt;Important -&lt;/strong&gt; The first word must be preceded by a hyphen as this is used to designate a group of words. It is this word that you must enter into the 3D Text screensaver 'textbox'. When you run the screensaver you will get a random showing af all the words under the hyphened word in the text file. You can add more sections to the text file (again give each section a hyphened keyword to use in the screen saver dialogue box). &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-8128565441032845364?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/8128565441032845364/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=8128565441032845364' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/8128565441032845364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/8128565441032845364'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2006/10/3d-text-screen-saver.html' title='3D Text Screen Saver'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-4347387415130638405</id><published>2006-10-09T07:10:00.000-04:00</published><updated>2006-10-09T07:11:00.390-04:00</updated><title type='text'>Safe Data: Backup and Recovery</title><content type='html'>It is critical to ensure data integrity in todays business world. Loss of data can set you back days or weeks and may put you in hot water with more than your boss or client. There are a few methods and means by which to safeguard your data and help you sleep at night. After deciding what sort of media you will use a backup schedule is the key to a good night's sleep. &lt;p&gt;Please have a look at this &lt;a href="http://www.sun.com/storage/white-papers/backup-article.html" target="_new"&gt;White Paper from Sun Microsystems&lt;/a&gt; and call me if you have any questions or concerns.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-4347387415130638405?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/4347387415130638405/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=4347387415130638405' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/4347387415130638405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/4347387415130638405'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2006/10/safe-data-backup-and-recovery.html' title='Safe Data: Backup and Recovery'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-4307248055254065644</id><published>2006-10-09T07:09:00.000-04:00</published><updated>2006-10-09T07:10:22.748-04:00</updated><title type='text'>Finding a PC on the network</title><content type='html'>If you have several hundred PCs in a domain and need to quickly find just one there's a quick trick to finding them. This is especially true if your org uses a odd naming conventions for the ComputerName. At a command prompt type '&lt;strong&gt;net view | find /i "&lt;em&gt;userid&lt;/em&gt;"&lt;/strong&gt;'. The userid is an example. If you want to explore this one further look up the details of the command FIND. You can also redirect the output and open it in NotePad for simplicity. and copy &amp; paste functionality.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-4307248055254065644?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/4307248055254065644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=4307248055254065644' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/4307248055254065644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/4307248055254065644'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2006/10/finding-pc-on-network.html' title='Finding a PC on the network'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-9060034910439206775</id><published>2006-10-09T07:08:00.000-04:00</published><updated>2006-10-09T07:09:08.166-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Internet Explorer'/><title type='text'>Internet Explorer opens Zip file as web page or undisplayed graphic.</title><content type='html'>&lt;p&gt;It seems that a Zip Plug-In or MIME-type handler of zip files may have stopped functioning. The best way to reset this is to uninstall or install, then uninstall such a tool.&lt;/p&gt; &lt;p&gt;The symptoms are such that unless you right-click on a link and Save As, clicking on a zip file just opens another, somewhat blank, web page.&lt;/p&gt; &lt;p&gt;You may install the &lt;a href="http://www.pkware.com/" target="_new"&gt;PKWare&lt;/a&gt; plug-in and, if don't really want to use it, remove it afterwards. If you do want it, please support the author by purchasing the full license.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-9060034910439206775?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/9060034910439206775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=9060034910439206775' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/9060034910439206775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/9060034910439206775'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2006/10/internet-explorer-opens-zip-file-as-web.html' title='Internet Explorer opens Zip file as web page or undisplayed graphic.'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-2008920315059628700</id><published>2006-10-09T07:06:00.000-04:00</published><updated>2006-10-09T07:08:08.196-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web development'/><title type='text'>Web Development Confinement to Screen Resolution Restrictions</title><content type='html'>When you build a web site your goal is to make it easy to read for your target audience. The layout is important and the content's readability from a font and presentation perspective and how the text reads. The target audience may have a specific preference as to browser, screen resolution, or age/reading level. Just as a newspaper must cater to it's target audience so must you in developing your web site. &lt;p&gt;One tool I have found useful is a &lt;a href="http://cstech.no-ip.com/personal/assets/wallpaper/screentemplate.zip"&gt;wallpaper template&lt;/a&gt;. I normally run at a high resolution (1600x1200) and remembering how things look to the common user (1024x768 these days, though it was once 800x600) is sometimes tough. This template helps keep your perspective. Simply re-size your browser to fit within the size you're targetting. If you're running Windows XP or (gasp) Windows 98 you could configure a second display to the appropriate resolution, but that's a different challenge. Windows 2000 doesn't actually have this capability, but it's my OS of choice.&lt;/p&gt; &lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; you may want to leave a little space at the bottom of the area for the task bar.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-2008920315059628700?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/2008920315059628700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=2008920315059628700' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/2008920315059628700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/2008920315059628700'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2006/10/web-development-confinement-to-screen.html' title='Web Development Confinement to Screen Resolution Restrictions'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-3517971454322580836</id><published>2006-05-09T07:18:00.000-04:00</published><updated>2006-10-09T07:19:49.792-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HelpDesk'/><category scheme='http://www.blogger.com/atom/ns#' term='CMD'/><title type='text'>For the Corporate Help Desk</title><content type='html'>&lt;p&gt;There is a basic presumption with these tools that your helpdesk/deskside people have Administrative rights to the desktop PCs. While some people are paranoid about this, with virus threats a real concern Administrative rights and remote control are essential. There should be policy regarding when and why the PC is accessed, especially for remote control.&lt;/p&gt; &lt;p&gt;One more consideration, though it may not be the way things are now, is that your systems should be built in a consistant manner. Different technical types do things different ways, that doesn't mean the way things are currently done are wrong, there are many good ways of doing things. Some techs prefer one large disk, others prefer a partitioned hard disk. There are arguments for both. The key is that throughout your organisation there's minimal varation.&lt;/p&gt; &lt;p&gt;These tools are formulated for one scheme where that hard disk is partitioned into 4 pieces. For a 40 Gb Drive it's likely C: 10Gb, D: 10Gb, E: 15Gb, and Y: 5Gb is the scheme though some variation in size may occur. At one time our systems were a single partition, the user's files trampled the space for OS files and caused excessive down-time. We're currently re-sizing systems due to a change in our application suite to ensure they are allocated enough space on C:. While this is time consuming it is necessary at this time based on choices beyond our control.&lt;/p&gt; &lt;p&gt;Our recent roll-out of systems has lessened the blow but the remaining systems need re-partitioning. While we are currently licensed for Symantec Ghost, we have decided to purchase licenses for Partition Magic to complete these systems efficiently. Re-Partitioning can be done using Ghost, with an added degree of safety, by backing up the system, then restoring it with the adjusted partition sizes.&lt;/p&gt; &lt;p&gt;Please note that long lines have been split. Look for ~SPLIT LINE~ to re-join these lines.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Checking Symantec Antivirus Defs Remotely&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;NOTE:&lt;/b&gt; X:\ISTOOLS is an accessible storage location for tools (duh). RMTSHARE.EXE is part of the Resource Kits for NT4/2000.&lt;/p&gt; &lt;pre&gt;&lt;b&gt;chkDefs.cmd&lt;/b&gt;&lt;br /&gt;@echo off&lt;br /&gt;color 1F&lt;br /&gt;SET KILLSHARE=0&lt;br /&gt;SET target=%1&lt;br /&gt;&lt;br /&gt;if "%target%"=="/?" GOTO HELP&lt;br /&gt;if "%target%"=="" SET /P target=Update which System?&lt;br /&gt;if "%target%"=="" goto help&lt;br /&gt;IF EXIST \\%TARGET%\C$\*.* GOTO DOIT&lt;br /&gt;X:\ISTOOLS\RMTSHARE \\%TARGET%\C$=C:\ | FIND /I "command failed"&lt;br /&gt;IF %ERRORLEVEL% EQU 0 GOTO FAILED&lt;br /&gt;&lt;br /&gt;SET KILLSHARE=1&lt;br /&gt;IF EXIST \\%TARGET%\C$\*.* GOTO DOIT&lt;br /&gt;&lt;br /&gt;:DOIT&lt;br /&gt;:VIEW&lt;br /&gt;START NOTEPAD "\\%TARGET%\c$\Program Files\  ~SPLIT LINE~&lt;br /&gt;            Common Files\Symantec Shared\VirusDefs\DEFINFO.DAT.&lt;br /&gt;goto end&lt;br /&gt;&lt;br /&gt;:HELP&lt;br /&gt;CLS&lt;br /&gt;color 4F&lt;br /&gt;echo   **************************************************************************&lt;br /&gt;echo   *                                                                        *&lt;br /&gt;echo   * chkDefs.cmd - Retrieves a remote systems Virus Defs Info.              *&lt;br /&gt;echo   *                                                                        *&lt;br /&gt;echo   **************************************************************************&lt;br /&gt;echo   * Usage:                                                                 *&lt;br /&gt;echo   *   chkDefs [computername]                                               *&lt;br /&gt;echo   *                                                                        *&lt;br /&gt;echo   *                                               8:42 AM 7/21/2004        *&lt;br /&gt;echo   **************************************************************************&lt;br /&gt;pause&lt;br /&gt;goto end&lt;br /&gt;:FAILED&lt;br /&gt;echo Could not create Remote Connection to %TARGET%&lt;br /&gt;goto end&lt;br /&gt;&lt;br /&gt;:NOTFOUND&lt;br /&gt;echo Could not find system %TARGET%&lt;br /&gt;goto end&lt;br /&gt;&lt;br /&gt;:end&lt;br /&gt;ATTRIB +R \\%TARGET%\c$\WINNT\system32\drivers\etc\HOSTS.&lt;br /&gt;IF %KILLSHARE% EQU 1 X:\ISTOOLS\RMTSHARE \\%TARGET%\C$ /d&lt;br /&gt;color&lt;br /&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b&gt;Internet Explorer Pop-Up Windows/Links are blank&lt;/b&gt;&lt;br /&gt;Occationally something goes wrong in Internet Explorer that ensures every pop-up window is blank. To fix this the simple answer is to run &lt;b&gt;'regsvr32 /s urlmon.dll'&lt;/b&gt; and all is well. For simplicity this CMD file corrects the problem while not exposing some of the tech of the solution.  &lt;/p&gt;  &lt;pre&gt;&lt;b&gt;fixBlankPopUp.cmd&lt;/b&gt;&lt;br /&gt;@echo off&lt;br /&gt;color 1F&lt;br /&gt;echo Expeiencing Blank Pop-Ups in Internet Explorer?&lt;br /&gt;echo Close your browser and all Internet Explorer windows.&lt;br /&gt;echo you're done come back here and...&lt;br /&gt;pause&lt;br /&gt;regsvr32 /S urlmon.dll&lt;br /&gt;echo Done. Thank-you.&lt;br /&gt;pause&lt;br /&gt;&lt;/pre&gt;  &lt;p&gt;&lt;b&gt;Changing the HOSTS file to protect those surfing users...&lt;/b&gt;&lt;br /&gt;The following will install a more restrictive HOSTS. file to protect or simply restrict a user's browsability. You may need to formulate or find some HOSTS files to accomodate your needs but the tools will work with any file you create. I have included a "Big Brother" option (HOSTS.BB) to use on those people who enjoy wasting company time.&lt;/p&gt; &lt;pre&gt;&lt;b&gt;setHOSTS.CMD&lt;/b&gt;&lt;br /&gt;@echo off&lt;br /&gt;color 1F&lt;br /&gt;SET KILLSHARE=0&lt;br /&gt;SET target=%1&lt;br /&gt;&lt;br /&gt;if "%target%"=="/?" GOTO HELP&lt;br /&gt;if "%target%"=="" SET /P target=Update which System?&lt;br /&gt;if "%target%"=="" goto help&lt;br /&gt;IF EXIST \\%TARGET%\C$\*.* GOTO DOIT&lt;br /&gt;X:\ISTOOLS\RMTSHARE \\%TARGET%\C$=C:\ | FIND /I "command failed"&lt;br /&gt;IF %ERRORLEVEL% EQU 0 GOTO FAILED&lt;br /&gt;&lt;br /&gt;SET KILLSHARE=1&lt;br /&gt;IF EXIST \\%TARGET%\C$\*.* GOTO DOIT&lt;br /&gt;&lt;br /&gt;:DOIT&lt;br /&gt;IF NOT EXIST \\%TARGET%\C$\*.* GOTO NOTFOUND&lt;br /&gt;IF "%2"==".BB" GOTO BROTHER&lt;br /&gt;IF "%2"==".O" GOTO ORIGINAL&lt;br /&gt;IF "%2"==".V" GOTO VIEW&lt;br /&gt;IF "%2"==".bB" GOTO BROTHER&lt;br /&gt;IF "%2"==".Bb" GOTO BROTHER&lt;br /&gt;IF "%2"==".bb" GOTO BROTHER&lt;br /&gt;IF "%2"==".b" GOTO BEAGLE&lt;br /&gt;IF "%2"==".B" GOTO BEAGLE&lt;br /&gt;IF "%2"==".o" GOTO ORIGINAL&lt;br /&gt;IF "%2"==".v" GOTO VIEW&lt;br /&gt;&lt;br /&gt;ATTRIB -R \\%TARGET%\c$\WINNT\system32\drivers\etc\HOSTS.&lt;br /&gt;XCOPY X:\ISTOOLS\HOSTS.TXT \\%TARGET%\c$\WINNT\system32\drivers\etc\HOSTS. /Y&lt;br /&gt;goto end&lt;br /&gt;:BROTHER&lt;br /&gt;ATTRIB -R \\%TARGET%\c$\WINNT\system32\drivers\etc\HOSTS.&lt;br /&gt;XCOPY X:\ISTOOLS\HOSTS_BB.TXT \\%TARGET%\c$\WINNT\system32\drivers\etc\HOSTS. /Y&lt;br /&gt;goto end&lt;br /&gt;:BEAGLE&lt;br /&gt;ATTRIB -R \\%TARGET%\c$\WINNT\system32\drivers\etc\HOSTS.&lt;br /&gt;XCOPY X:\ISTOOLS\HOSTS_B.TXT \\%TARGET%\c$\WINNT\system32\drivers\etc\HOSTS. /Y&lt;br /&gt;goto end&lt;br /&gt;:ORIGINAL&lt;br /&gt;ATTRIB -R \\%TARGET%\c$\WINNT\system32\drivers\etc\HOSTS.&lt;br /&gt;XCOPY X:\ISTOOLS\HOSTS_O.TXT \\%TARGET%\c$\WINNT\system32\drivers\etc\HOSTS. /Y&lt;br /&gt;goto end&lt;br /&gt;:VIEW&lt;br /&gt;START NOTEPAD \\%TARGET%\c$\WINNT\system32\drivers\etc\HOSTS.&lt;br /&gt;goto end&lt;br /&gt;&lt;br /&gt;:HELP&lt;br /&gt;CLS&lt;br /&gt;color 4F&lt;br /&gt;echo   **************************************************************************&lt;br /&gt;echo   *                                                                        *&lt;br /&gt;echo   * setHOSTS.CMD is used to update or reset a HOSTS. file on a TCI system. *&lt;br /&gt;echo   *                                                                        *&lt;br /&gt;echo   **************************************************************************&lt;br /&gt;echo   * Usage:                                                                 *&lt;br /&gt;echo   *   setHOSTS {computername] [switch]                                     *&lt;br /&gt;echo   *                                                                        *&lt;br /&gt;echo   *   Default Action: place "safe" hosts file on system to protect         *&lt;br /&gt;echo   *                   against hijackers and adware websites.               *&lt;br /&gt;echo   *                                                                        *&lt;br /&gt;echo   *                                                                        *&lt;br /&gt;echo   *   Switches:                                                            *&lt;br /&gt;echo   *     .O - Original HOSTS. file                                          *&lt;br /&gt;echo   *     .V - View user's Host file                                         *&lt;br /&gt;echo   *                                                                        *&lt;br /&gt;echo   *                                               10:10 AM 6/24/2004       *&lt;br /&gt;echo   **************************************************************************&lt;br /&gt;pause&lt;br /&gt;goto end&lt;br /&gt;:FAILED&lt;br /&gt;echo Could not create Remote Connection to %TARGET%&lt;br /&gt;goto end&lt;br /&gt;&lt;br /&gt;:NOTFOUND&lt;br /&gt;echo Could not find system %TARGET%&lt;br /&gt;goto end&lt;br /&gt;&lt;br /&gt;:end&lt;br /&gt;ATTRIB +R \\%TARGET%\c$\WINNT\system32\drivers\etc\HOSTS.&lt;br /&gt;IF %KILLSHARE% EQU 1 X:\ISTOOLS\RMTSHARE \\%TARGET%\C$ /d&lt;br /&gt;color&lt;br /&gt;pause&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;&lt;b&gt;Wallpaper and ScreenSaver Enforcement&lt;/b&gt;&lt;br /&gt;Ensuring the company is protected and that the corporate look and feel is consistent is critical. Not every company cares but those that do will like this. This can be enforced remotely using this tool, the added benefit is that it re-enforces itself once installed.&lt;/p&gt; &lt;p&gt;While I have customized this for each type of machine, your preference may be to customize by department. The whole system consists of two batch files, a menu file, plus the support files, which are stored in the support folder and dependant upon options. The screensaver I use was created using &lt;a href="http://www.irfanview.com/" target="new"&gt;IrfanView&lt;/a&gt; 3.85, the perfect tool for simple graphic manipulation. The .ICO is an extra. I haven't decided what to do with that yet.&lt;/p&gt;   &lt;pre&gt;&lt;b&gt;setCorp.CMD&lt;/b&gt; - FIRST FILE&lt;br /&gt;&lt;br /&gt;@echo off&lt;br /&gt;color 1F&lt;br /&gt;SET KILLSHARE=0&lt;br /&gt;SET target=%1&lt;br /&gt;&lt;br /&gt;if "%target%"=="/?" GOTO HELP&lt;br /&gt;if "%target%"=="" SET /P target=Update which System?&lt;br /&gt;if "%target%"=="" goto help&lt;br /&gt;if "%target%"=="." SET TARGET=%COMPUTERNAME%&lt;br /&gt;&lt;br /&gt;IF EXIST \\%TARGET%\C$\*.* GOTO DOIT&lt;br /&gt;\\tcint1\apps\ISTOOLS\RMTSHARE \\%TARGET%\C$=C:\ | FIND /I "command failed"&lt;br /&gt;IF %ERRORLEVEL% EQU 0 GOTO FAILED&lt;br /&gt;&lt;br /&gt;SET KILLSHARE=1&lt;br /&gt;IF EXIST \\%TARGET%\C$\*.* GOTO DOIT&lt;br /&gt;&lt;br /&gt;:DOIT&lt;br /&gt;IF NOT EXIST \\%TARGET%\C$\*.* GOTO NOTFOUND&lt;br /&gt;SET RESP=%2&lt;br /&gt;IF "%RESP%"=="" GOTO NOSWITCH&lt;br /&gt;echo Configuring %TARGET% as %RESP%:&lt;br /&gt;GOTO PICK%RESP%&lt;br /&gt;goto NOSWITCH&lt;br /&gt;&lt;br /&gt;:NOSWITCH&lt;br /&gt;if not exist \\tcint1\apps\ISTOOLS\setCorpChoices.txt goto Default&lt;br /&gt;CLS&lt;br /&gt;echo Updating System: %TARGET%&lt;br /&gt;type \\tcint1\apps\ISTOOLS\setCorpChoices.txt&lt;br /&gt;CHOICE /C:123456789Q Selection:&lt;br /&gt;&lt;br /&gt;IF %ERRORLEVEL% EQU 1 SET RESP=Default&lt;br /&gt;IF %ERRORLEVEL% EQU 2 SET RESP=T41&lt;br /&gt;IF %ERRORLEVEL% EQU 3 SET RESP=T30&lt;br /&gt;IF %ERRORLEVEL% EQU 4 SET RESP=T23&lt;br /&gt;IF %ERRORLEVEL% EQU 5 SET RESP=T21&lt;br /&gt;IF %ERRORLEVEL% EQU 6 SET RESP=S50&lt;br /&gt;IF %ERRORLEVEL% EQU 7 SET RESP=M42&lt;br /&gt;IF %ERRORLEVEL% EQU 8 SET RESP=M41&lt;br /&gt;IF %ERRORLEVEL% EQU 9 SET RESP=M200&lt;br /&gt;IF %ERRORLEVEL% EQU 10 SET RESP=&lt;br /&gt;IF %ERRORLEVEL% EQU 11 SET RESP=&lt;br /&gt;CLS&lt;br /&gt;IF NOT "%RESP%"=="" echo Configuring for %RESP%:&lt;br /&gt;GOTO PICK%RESP%&lt;br /&gt;&lt;br /&gt;:Pick&lt;br /&gt;CLS&lt;br /&gt;echo No Selection, cancelled.&lt;br /&gt;pause&lt;br /&gt;goto end&lt;br /&gt;&lt;br /&gt;:PickDefault&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.BMP &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;SET BITMAP=CORPSTD.BMP&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.CMD &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.SCR &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT\SYSTEM32 /I /Y /Q&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.ICO &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;goto COMPLETE&lt;br /&gt;&lt;br /&gt;:PickT41&lt;br /&gt;XCOPY X:\istools\setCorpsrc\WPT41_*.BMP &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;SET BITMAP=WPT41_1600.BMP 2&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.CMD &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.SCR &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT\SYSTEM32 /I /Y /Q&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.ICO &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;goto COMPLETE&lt;br /&gt;&lt;br /&gt;:PickT30&lt;br /&gt;XCOPY X:\istools\setCorpsrc\TCI_T30*.BMP &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;SET BITMAP=TCI_T30_1400.BMP 2&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.CMD &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.SCR &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT\SYSTEM32 /I /Y /Q&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.ICO &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;goto COMPLETE&lt;br /&gt;&lt;br /&gt;:PickT23&lt;br /&gt;XCOPY X:\istools\setCorpsrc\TCI_T23*.BMP &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;SET BITMAP=TCI_T23_1280.BMP 2&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.CMD &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.SCR &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT\SYSTEM32 /I /Y /Q&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.ICO &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;goto COMPLETE&lt;br /&gt;&lt;br /&gt;:PickT21&lt;br /&gt;XCOPY X:\istools\setCorpsrc\TCI_T21*.BMP &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;SET BITMAP=TCI_T21_1024.BMP 2&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.CMD &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.SCR &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT\SYSTEM32 /I /Y /Q&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.ICO &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;goto COMPLETE&lt;br /&gt;&lt;br /&gt;:PickS50&lt;br /&gt;XCOPY X:\istools\setCorpsrc\TCI_S50*.BMP &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;SET BITMAP=TCI_S50_1600.BMP 2&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.CMD &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.SCR &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT\SYSTEM32 /I /Y /Q&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.ICO &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;goto COMPLETE&lt;br /&gt;&lt;br /&gt;:PickM42&lt;br /&gt;XCOPY X:\istools\setCorpsrc\TCI_M42*.BMP &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;SET BITMAP=TCI_M42_1400.BMP 2&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.CMD &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.SCR &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT\SYSTEM32 /I /Y /Q&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.ICO &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;goto COMPLETE&lt;br /&gt;&lt;br /&gt;:PickM41&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.BMP &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;SET BITMAP=CORPSTD.BMP&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.CMD &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.SCR &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT\SYSTEM32 /I /Y /Q&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.ICO &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;goto COMPLETE&lt;br /&gt;&lt;br /&gt;:PickM200&lt;br /&gt;XCOPY X:\istools\setCorpsrc\TCI_M200*.BMP &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;SET BITMAP=TCI_M200_SPECIAL.BMP&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.CMD &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.SCR &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT\SYSTEM32 /I /Y /Q&lt;br /&gt;XCOPY X:\istools\setCorpsrc\CORPSTD.ICO &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;             \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;goto COMPLETE&lt;br /&gt;&lt;br /&gt;:COMPLETE&lt;br /&gt;XCOPY X:\istools\REG.EXE \\%TARGET%\c$\WINNT /I /Y /Q&lt;br /&gt;reg ADD \\%TARGET%\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;            /V setCorp /t REG_SZ /d "C:\WINNT\CORPSTD.CMD %BITMAP%" /f&lt;br /&gt;reg QUERY \\%TARGET%\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /V setCorp&lt;br /&gt;color 4F&lt;br /&gt;echo   **************************************************************************&lt;br /&gt;echo   *                                                                        *&lt;br /&gt;echo   * DONE: WALLPAPER AND BITMAPS WILL BE REPLACED ON NEXT REBOOT            *&lt;br /&gt;echo   *                                                                        *&lt;br /&gt;echo   *                                               9:05 AM 7/27/2004        *&lt;br /&gt;echo   **************************************************************************&lt;br /&gt;goto end&lt;br /&gt;&lt;br /&gt;:HELP&lt;br /&gt;CLS&lt;br /&gt;color 4F&lt;br /&gt;echo   **************************************************************************&lt;br /&gt;echo   *                                                                        *&lt;br /&gt;echo   * setCorp.CMD is used to send a Virus Fix to a user's system             *&lt;br /&gt;echo   *                                                                        *&lt;br /&gt;echo   **************************************************************************&lt;br /&gt;echo   * Usage:                                                                 *&lt;br /&gt;echo   *   setCorp switch [computername]                                        *&lt;br /&gt;echo   *                                                                        *&lt;br /&gt;echo   *                                                                        *&lt;br /&gt;echo   *   Switches:                                                            *&lt;br /&gt;echo   *     d - Default Toyota Wallpaper/Screensaver                           *&lt;br /&gt;echo   *                                                                        *&lt;br /&gt;echo   *                                               9:07 AM 7/27/2004        *&lt;br /&gt;echo   **************************************************************************&lt;br /&gt;pause&lt;br /&gt;goto end&lt;br /&gt;:FAILED&lt;br /&gt;echo Could not create Remote Connection to %TARGET%&lt;br /&gt;goto end&lt;br /&gt;&lt;br /&gt;:NOTFOUND&lt;br /&gt;echo Could not find system %TARGET%&lt;br /&gt;goto end&lt;br /&gt;&lt;br /&gt;:end&lt;br /&gt;IF %KILLSHARE% EQU 1 X:\ISTOOLS\RMTSHARE \\%TARGET%\C$ /d&lt;br /&gt;color&lt;br /&gt;pause&lt;br /&gt;&lt;br /&gt;&lt;b&gt;CORPSTD.CMD&lt;/b&gt;&lt;br /&gt;@ECHO OFF&lt;br /&gt;SET WPStyle=%2&lt;br /&gt;IF "%WPSTYLE%"=="" SET WPStyle=0&lt;br /&gt;SET BITMAP=%~1&lt;br /&gt;IF "%BITMAP%"=="" then SET BITMAP="CORPSTD.BMP"&lt;br /&gt;ECHO Resetting to TCI Standards...&lt;br /&gt;ECHO Resetting Wallpaper...&lt;br /&gt;REG ADD "HKCU\Control Panel\Desktop" &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;          /V WallpaperStyle /T REG_SZ /D %WPSTYLE% /F&lt;br /&gt;REG ADD "HKCU\Control Panel\Desktop" &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;          /V Wallpaper /T REG_SZ /D "C:\WINNT\%BITMAP%" /F&lt;br /&gt;REG ADD "HKCU\Control Panel\Desktop" &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;          /V TileWallpaper /T REG_SZ /D 0 /F&lt;br /&gt;REG ADD "HKCU\Control Panel\Colors" &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;           /V Background /T REG_SZ /D "0 0 0" /F&lt;br /&gt;ECHO Resetting ScreenSaver...&lt;br /&gt;REG ADD "HKCU\Control Panel\Desktop" /V SCRNSAVE.EXE &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;         /T REG_SZ /D "C:\WINNT\SYSTEM32\CORPSTD.SCR" /F&lt;br /&gt;REG ADD "HKCU\Control Panel\Desktop" &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;          /V ScreenSaveActive /T REG_SZ /D 1 /F&lt;br /&gt;REG ADD "HKCU\Control Panel\Desktop" &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;          /V ScreenSaverIsSecure /T REG_SZ /D 1 /F&lt;br /&gt;REG ADD "HKCU\Control Panel\Desktop" &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;          /V ScreenSaveTimeOut /T REG_SZ /D 600 /F&lt;br /&gt;ECHO Resetting Wallpaper...&lt;br /&gt;REG ADD "HKU\.Default\Control Panel\Desktop" &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;          /V WallpaperStyle /T REG_SZ /D %WPSTYLE% /F&lt;br /&gt;REG ADD "HKU\.Default\Control Panel\Desktop" &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;          /V Wallpaper /T REG_SZ /D "C:\WINNT\%BITMAP%" /F&lt;br /&gt;REG ADD "HKU\.Default\Control Panel\Desktop" &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;          /V TileWallpaper /T REG_SZ /D 0 /F&lt;br /&gt;REG ADD "HKU\.Default\Control Panel\Colors" &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;           /V Background /T REG_SZ /D "0 0 0" /F&lt;br /&gt;ECHO Resetting ScreenSaver...&lt;br /&gt;REG ADD "HKU\.Default\Control Panel\Desktop" &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;          /V SCRNSAVE.EXE /T REG_SZ /D "C:\WINNT\SYSTEM32\CORPSTD.SCR" /F&lt;br /&gt;REG ADD "HKU\.Default\Control Panel\Desktop" &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;          /V ScreenSaveActive /T REG_SZ /D 1 /F&lt;br /&gt;REG ADD "HKU\.Default\Control Panel\Desktop" &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;          /V ScreenSaverIsSecure /T REG_SZ /D 1 /F&lt;br /&gt;REG ADD "HKU\.Default\Control Panel\Desktop" &lt;i&gt;&lt;b&gt;~SPLIT LINE~&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;          /V ScreenSaveTimeOut /T REG_SZ /D 60 /F&lt;br /&gt;ECHO DONE.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;setCorpChoices.txt&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Please Select a Bitmap Collection to distribute:&lt;br /&gt;================================================&lt;br /&gt;&lt;br /&gt;  1 - Default/Generic Corporate Suite&lt;br /&gt;&lt;br /&gt;  2 - T41 Laptop&lt;br /&gt;  3 - T30 Laptop&lt;br /&gt;  4 - T23 Laptop&lt;br /&gt;  5 - T21 Laptop&lt;br /&gt;&lt;br /&gt;  6 - S50 Desktop&lt;br /&gt;  7 - M42 Desktop&lt;br /&gt;  8 - M41 Desktop&lt;br /&gt;&lt;br /&gt;  9 - M200 Toshiba Portege&lt;br /&gt;&lt;br /&gt;  Q - Quit/Abort&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-3517971454322580836?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/3517971454322580836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=3517971454322580836' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/3517971454322580836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/3517971454322580836'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2006/05/for-corporate-help-desk.html' title='For the Corporate Help Desk'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-4284952744167735974</id><published>2006-01-01T07:09:00.000-05:00</published><updated>2006-10-09T07:09:50.170-04:00</updated><title type='text'>Can't get into PCAnywhere after re-boot.</title><content type='html'>If you're luck enough to be the Administrator on the remote PC and running Windows2000 locally (and Windows NT or better remotely) do the following: &lt;ol&gt;&lt;li&gt;Right-click on 'My Computer', select Manage&lt;/li&gt;&lt;li&gt;From the Action menu, select 'Connect to another computer...'&lt;/li&gt;&lt;li&gt;Enter the name of the PC you need to control. Press OK.&lt;/li&gt;&lt;li&gt;From the 'Services and Applications' tree, select Services.&lt;/li&gt;&lt;li&gt;From the right-pane, select the pcAnywhere service.&lt;/li&gt;&lt;li&gt;Right-click on the service and select 'Start'&lt;/li&gt;&lt;li&gt;Close 'Computer Management' and attempt connection through pcAnywhere.&lt;/li&gt;&lt;/ol&gt; &lt;strong&gt;Note:&lt;/strong&gt; If you need to do this from a command prompt (or you have WindowsNT) you may also use netsvc.exe from the Windows NT Resource Kit.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-4284952744167735974?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/4284952744167735974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=4284952744167735974' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/4284952744167735974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/4284952744167735974'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2006/01/cant-get-into-pcanywhere-after-re-boot.html' title='Can&apos;t get into PCAnywhere after re-boot.'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-7198741344353418773</id><published>2006-01-01T03:58:00.000-05:00</published><updated>2006-10-09T07:04:08.001-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CMD'/><category scheme='http://www.blogger.com/atom/ns#' term='batch'/><title type='text'>Create a folder based on today's date.</title><content type='html'>&lt;p&gt;Though this can be applied in many ways, the WindowsNT/2000 Command Prompt has some powerful differences over the old MS-DOS Batch Language. the FOR command is just one difference. The delimiters specified and the order of the variables (%a, %b, %c) will depend on your localized settings. By default the following should create a folder called '20031129' (based on November 29th, 2003).&lt;/p&gt; &lt;pre&gt;FOR /F "tokens=2,3,4 delims=/ " %a in ('date /t') do mkdir %c%a%b&lt;br /&gt;&lt;/pre&gt;   &lt;p&gt;This could be applied to a daily backup procedure using PKZIP from a command-line.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-7198741344353418773?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/7198741344353418773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=7198741344353418773' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/7198741344353418773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/7198741344353418773'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2006/01/create-folder-based-on-todays-date.html' title='Create a folder based on today&apos;s date.'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-8956836664107587169</id><published>2005-10-10T07:04:00.000-04:00</published><updated>2006-10-09T07:05:30.050-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Virus Removal'/><title type='text'>Killing off a Virus attached to explorer.exe (i.e. NovArg.m) Windows 2000/XP</title><content type='html'>Because this nasty virus configures itself to launch when explorer loads, preying on the extensibility of the interface, it can be tricky to quickly remove the virus one it has settled in. I found that in a Corporate/Help Desk scenario, utilization of the remote administration functions can resolve this quickly.  &lt;ol&gt;&lt;li&gt;have the user log off the system to the CTRL-ALT-DELETE screen&lt;/li&gt;&lt;li&gt;connect to the system remotely, if necessary using the UNC path \\[computername]\C$\WINNT\SYSTEM32&lt;/li&gt;&lt;li&gt;locate shimgapi.dll, delete it&lt;/li&gt;&lt;li&gt;locate taskmon.exe, delete it&lt;/li&gt;&lt;li&gt;have the user log back in&lt;/li&gt;&lt;li&gt;using &lt;b&gt;regedit&lt;/b&gt; locally or remotely (slower) search the affected system for registry keys relating to taskmon.exe, and shimgapi.dll&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;This logic can be applied to many situations, but this was our recent fix. Your first defense is ensuring your virus definitions are up-to-date though user-education is often just as valuable. For more information research the virus at the &lt;a href="http://www.symantec.com/" target="_new"&gt;Symantec&lt;/a&gt; or &lt;a href="http://www.mcafee.com/" target="_new"&gt;McAfee&lt;/a&gt; web sites. Symantec now has a removal tool. You might want to use this as it is more thorough.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-8956836664107587169?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/8956836664107587169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=8956836664107587169' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/8956836664107587169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/8956836664107587169'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2005/10/killing-off-virus-attached-to.html' title='Killing off a Virus attached to explorer.exe (i.e. NovArg.m) Windows 2000/XP'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-3294894971919873402</id><published>2005-10-09T07:21:00.000-04:00</published><updated>2006-10-09T07:22:44.964-04:00</updated><title type='text'>Search and Destroy</title><content type='html'>&lt;p&gt;The risks to the corporate network by the use of MSN Messenger and similar programs is a minefield in your own network. Using SMS can often detect it and while SMS does an excellent job of detection, if it's not an option, there are other means of detection and destruction using a couple of slighly complex batch files. The following files will find and destroy MSN, though it can be adapted to any file in theory.&lt;/p&gt; &lt;p&gt;I use a couple of PSTools (&lt;a href="http://www.sysinternals.com/" target="_new"&gt;www.sysinternals.com&lt;/a&gt;) to kill it and replace it though detection is enough with strong backing from management. The process is designed to capture a listing of users. This file will NOT work if the install directory is in a non-standard location though I go through some effort to find it in a few places. There's a few things you can do to find it through detection using PSList but this is only if it's running, PSInfo might work too. I did not use these tools for detection in this application.&lt;/p&gt; &lt;p&gt;&lt;b&gt;DOALLPCS.cmd:&lt;/b&gt; This batch file will locate most if not all PCs on the network, it's presumed you would have administrative rights on these PCs. It accepts two parameters, the first of which is the batch file to run, the second is passed to the natch file is specified. In this application the batch file specified is the next CMD file, FindMSN. Note the &lt;i&gt;&lt;span style="background-color: rgb(0, 204, 102);"&gt;~SPLIT LINE~&lt;/span&gt;&lt;/i&gt; tags... the next line is supposed to be part of this line.&lt;/p&gt; &lt;pre&gt;@echo off&lt;br /&gt;echo %TIME%: Start&lt;br /&gt;for /F "skip=1 tokens=1 delims=\ " %%a in ('NET VIEW') &lt;span style="background-color: rgb(0, 204, 102);"&gt;~SPLIT LINE~&lt;/span&gt;&lt;br /&gt;  do START "Checking %%a using %1..." /MIN %1 %%a BATCH %~2&lt;br /&gt;echo %TIME%: End - %1&lt;br /&gt;:end&lt;br /&gt;&lt;/pre&gt;   &lt;p&gt;&lt;b&gt;FindMSN.CMD:&lt;/b&gt; This is the worker in this process. It's big and I'll try to document this in a helpful manner.&lt;/p&gt; &lt;pre&gt;@echo off&lt;br /&gt;SET KILLSHARE=NO&lt;br /&gt;SET TARGET=%~1&lt;br /&gt;ECHO %TARGET%...&lt;br /&gt;&lt;br /&gt;REG QUERY \\%TARGET%\HKLM\SOFTWARE\Microsoft\MSNMessenger &lt;span style="background-color: rgb(0, 204, 102);"&gt;~SPLIT LINE~&lt;/span&gt;&lt;br /&gt;  /V InstallationDirectory&lt;br /&gt;IF %ERRORLEVEL% EQU 1 GOTO NOTPRESENT&lt;br /&gt;&lt;br /&gt;REG QUERY \\%TARGET%\HKLM\SOFTWARE\Microsoft\MSNMessenger &lt;span style="background-color: rgb(0, 204, 102);"&gt;~SPLIT LINE~&lt;/span&gt;&lt;br /&gt;  /V InstallationDirectory|FIND /I "C:"&lt;br /&gt;IF %ERRORLEVEL% EQU 0 GOTO ONC&lt;br /&gt;&lt;br /&gt;REG QUERY \\%TARGET%\HKLM\SOFTWARE\Microsoft\MSNMessenger &lt;span style="background-color: rgb(0, 204, 102);"&gt;~SPLIT LINE~&lt;/span&gt;&lt;br /&gt;  /V InstallationDirectory|FIND /I "D:"&lt;br /&gt;IF %ERRORLEVEL% EQU 0 GOTO OND&lt;br /&gt;&lt;br /&gt;REG QUERY \\%TARGET%\HKLM\SOFTWARE\Microsoft\MSNMessenger &lt;span style="background-color: rgb(0, 204, 102);"&gt;~SPLIT LINE~&lt;/span&gt;&lt;br /&gt;  /V InstallationDirectory|FIND /I "E:"&lt;br /&gt;IF %ERRORLEVEL% EQU 0 GOTO ONE&lt;br /&gt;pause&lt;br /&gt;GOTO END&lt;br /&gt;&lt;br /&gt;:ONC&lt;br /&gt;echo C Drive&lt;br /&gt;SET LOCATION=\\%TARGET%\C$&lt;br /&gt;ECHO %LOCATION%&lt;br /&gt;IF EXIST %LOCATION%\*.* GOTO DOIT&lt;br /&gt;\\tcint1\apps\ISTOOLS\RMTSHARE %LOCATION%=C:\ | &lt;span style="background-color: rgb(0, 204, 102);"&gt;~SPLIT LINE~&lt;/span&gt;&lt;br /&gt;  FIND /I "command failed"&lt;br /&gt;IF %ERRORLEVEL% EQU 0 GOTO FAILED&lt;br /&gt;SET KILLSHARE=YES&lt;br /&gt;GOTO DOIT&lt;br /&gt;&lt;br /&gt;:OND&lt;br /&gt;echo D Drive&lt;br /&gt;SET LOCATION=%TARGET%\D$&lt;br /&gt;IF EXIST %LOCATION%\*.* GOTO DOIT&lt;br /&gt;\\tcint1\apps\ISTOOLS\RMTSHARE %LOCATION%=D:\ | &lt;span style="background-color: rgb(0, 204, 102);"&gt;~SPLIT LINE~&lt;/span&gt;&lt;br /&gt;  FIND /I "command failed"&lt;br /&gt;IF %ERRORLEVEL% EQU 0 GOTO FAILED&lt;br /&gt;SET KILLSHARE=YES&lt;br /&gt;GOTO DOIT&lt;br /&gt;&lt;br /&gt;:ONE&lt;br /&gt;echo E Drive&lt;br /&gt;SET LOCATION=%TARGET%\E$&lt;br /&gt;IF EXIST %LOCATION%\*.* GOTO DOIT&lt;br /&gt;\\tcint1\apps\ISTOOLS\RMTSHARE %LOCATION%=E:\ | &lt;span style="background-color: rgb(0, 204, 102);"&gt;~SPLIT LINE~&lt;/span&gt;&lt;br /&gt;  FIND /I "command failed"&lt;br /&gt;IF %ERRORLEVEL% EQU 0 GOTO FAILED&lt;br /&gt;SET KILLSHARE=YES&lt;br /&gt;GOTO DOIT&lt;br /&gt;&lt;br /&gt;:DOIT&lt;br /&gt;ECHO Check Typical Locations...&lt;br /&gt;IF EXIST "%LOCATION%\Program Files\MSN Messenger\*.*" GOTO Found&lt;br /&gt;IF EXIST "%LOCATION%\MSN Messenger\*.*" GOTO Found&lt;br /&gt;echo Not Found&lt;br /&gt;goto end&lt;br /&gt;&lt;br /&gt;:Found&lt;br /&gt;echo Found...&lt;br /&gt;IF NOT exist "FoundMSN" MKDIR "FoundMSN"&lt;br /&gt;echo %1 %DATE% %TIME% &gt;&gt; FoundMSN\%1.txt&lt;br /&gt;REG QUERY \\%TARGET%\HKLM\SOFTWARE\Microsoft\MSNMessenger &lt;span style="background-color: rgb(0, 204, 102);"&gt;~SPLIT LINE~&lt;/span&gt;&lt;br /&gt;  /V InstallationDirectory &gt;&gt; FoundMSN\%1.txt&lt;br /&gt;echo %LOCATION% &gt;&gt; FoundMSN\%1.txt&lt;br /&gt;dir "%LOCATION%\Program Files\MSN Messenger\*.*" &gt;&gt; FoundMSN\%1.txt&lt;br /&gt;dir "%LOCATION%\MSN Messenger\*.*" &gt;&gt; FoundMSN\%1.txt&lt;br /&gt;pslist \\%TARGET% |FIND /i "msnmsgr" &gt;&gt; FoundMSN\%1.txt&lt;br /&gt;IF %errorlevel% EQU 0 pskill \\%TARGET% msnmsgr&lt;br /&gt;&lt;br /&gt;:NOTRUNNING&lt;br /&gt;IF NOT EXIST "%LOCATION%\Program Files\MSN Messenger\msnmsgr.exe" GOTO ALT1&lt;br /&gt;dir "%LOCATION%\Program Files\MSN Messenger\*.*" &gt;&gt; FoundMSN\%1.txt&lt;br /&gt;Xcopy F:\msnmsgr.exe "%LOCATION%\Program Files\MSN Messenger" /Y /I&lt;br /&gt;goto wrapup&lt;br /&gt;&lt;br /&gt;:ALT1&lt;br /&gt;IF NOT EXIST "%LOCATION%\MSN Messenger\*.*" GOTO HIDDEN&lt;br /&gt;dir "%LOCATION%\MSN Messenger\*.*" &gt;&gt; FoundMSN\%1.txt&lt;br /&gt;Xcopy F:\msnmsgr.exe "%LOCATION%\MSN Messenger" /Y /I&lt;br /&gt;goto wrapup&lt;br /&gt;&lt;br /&gt;:HIDDEN&lt;br /&gt;echo Search for EXEcutable... &gt;&gt; FoundMSN\%1.txt&lt;br /&gt;goto wrapup&lt;br /&gt;&lt;br /&gt;:WRAPUP&lt;br /&gt;if not exist "\\%TARGET%\e$\My Received Files\msnmsgr.exe" goto end&lt;br /&gt;IF NOT EXIST FoundMSN\%1_MRF MKDIR FoundMSN\MRFList&lt;br /&gt;REM start /min x:\istools\robocopy "\\%TARGET%\e$\My Received Files" &lt;span style="background-color: rgb(0, 204, 102);"&gt;~SPLIT LINE~&lt;/span&gt;&lt;br /&gt;  FoundMSN\%1_MRF *.* /E /XO /V /ETA&lt;br /&gt;DIR "\\%TARGET%\e$\My Received Files\*.*" &gt;&gt; FoundMSN\MRFList\%1_MRF.TXT&lt;br /&gt;IF "%2"=="NOTIFY" call notify %1 "MSN Messenger"&lt;br /&gt;IF "%3"=="NOTIFY" call notify %1 "MSN Messenger"&lt;br /&gt;goto end&lt;br /&gt;&lt;br /&gt;:FAILED&lt;br /&gt;echo Cannot connect to %TARGET%. Aborted.&lt;br /&gt;&lt;br /&gt;:end&lt;br /&gt;:NOTPRESENT&lt;br /&gt;IF "%KILLSHARE%"=="YES" RMTSHARE %LOCATION% /d&lt;br /&gt;echo done&lt;br /&gt;IF "%2"=="BATCH" exit&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;&lt;b&gt;BTW:&lt;/b&gt; I don't think this is necessarily the BEST way to do this, it's one way. You may notice I spawn this into many VMs and this can take it's toll but I only need to watch 500-700 PCs. There are ideas you can take from this to do good or evil, please do good. Oh... There's one more batch file I didn't mention... NOTIFY.CMD. This is a wrapped NET SEND to the machine that's been examined. It tells them they're on the list of people that are about to have a very bad day.&lt;/p&gt;  &lt;p&gt;This tool is designed to ENSURE that all systems that had received the Microsoft Patches via SMS have been rebooted and/or reported. It uses the DOALLPCS.CMD or DOALLPCS1.CMD which are in Trick 4.&lt;/p&gt;  &lt;pre&gt;@echo off&lt;br /&gt;SET TARGET=%~1&lt;br /&gt;SET SEARCHID=MSEMF &lt;span style="background-color: rgb(255, 153, 51);"&gt; 1 &lt;/span&gt;&lt;br /&gt;ECHO Checking Target: %TARGET%...&lt;br /&gt;&lt;br /&gt;IF /I "%TARGET%"=="%COMPUTERNAME%" echo Cannot Reboot Self...&amp;goto end &lt;span style="background-color: rgb(255, 153, 51);"&gt; 2 &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;PING -n 1 %target%|find /i "Reply from" &lt;span style="background-color: rgb(255, 153, 51);"&gt; 3 &lt;/span&gt;&lt;br /&gt;if %errorlevel% EQU 0 goto :checkver&lt;br /&gt;goto END&lt;br /&gt;&lt;br /&gt;:checkver &lt;span style="background-color: rgb(255, 153, 51);"&gt; 4 &lt;/span&gt;&lt;br /&gt;For /F "skip=1  tokens=1,2 delims=:" %%a in ('&lt;span style="background-color: rgb(204, 204, 204);"&gt;psinfo \\%TARGET%&lt;/span&gt;') do &lt;span style="background-color: rgb(0, 204, 102);"&gt;~SPLIT LINE~&lt;/span&gt;&lt;br /&gt;  call :SetVars "%%a" "%%b"&lt;br /&gt;IF "%NU_Product type%"=="Server" goto end&lt;br /&gt;IF "%NU_Product type%"=="Professional" goto COI&lt;br /&gt;goto end&lt;br /&gt;&lt;br /&gt;:COI &lt;span style="background-color: rgb(255, 153, 51);"&gt; 5 &lt;/span&gt;&lt;br /&gt;ECHO %TARGET%: %NU_Uptime%&gt;&gt; F:\UPTIME.TXT&lt;br /&gt;SET /A X12=%NU_Uptime:~0,2%&lt;br /&gt;REM IF %X12%  EQU 0 echo Not Required...&amp;goto end&lt;br /&gt;:: ---------------------------------------------------&lt;br /&gt;:: PAYLOAD&lt;br /&gt;:: ---------------------------------------------------&lt;br /&gt;&lt;br /&gt;:DETECT FILE - END &lt;span style="background-color: rgb(255, 153, 51);"&gt; 6 &lt;/span&gt;&lt;br /&gt; IF NOT EXIST "\\%TARGET%\C$\&lt;span style="background-color: rgb(204, 204, 204);"&gt;Program Files\Common Files\&lt;span style="background-color: rgb(0, 204, 102);"&gt;~SPLIT LINE~&lt;/span&gt;&lt;br /&gt;  Microsoft Shared\Grphflt\MS.EMF&lt;/span&gt;" GOTO END&lt;br /&gt; IF NOT EXIST 20051108\*.* MKDIR &lt;span style="background-color: rgb(204, 204, 204);"&gt;20051108&lt;/span&gt;&lt;br /&gt; ECHO Found&lt;br /&gt; ECHO FOUND MS.EMF AT %DATE% %TIME% &gt;&gt; &lt;span style="background-color: rgb(204, 204, 204);"&gt;20051108&lt;/span&gt;\%TARGET%_%SEARCHID%.LOG&lt;br /&gt;:DETECT FILE - END&lt;br /&gt;&lt;br /&gt;:: REBOOT CODE &lt;span style="background-color: rgb(255, 153, 51);"&gt; 7 &lt;/span&gt;&lt;br /&gt; goto NOREBOOT&lt;br /&gt; echo g:\istools\shutdown -m \\%target% -t 30 -r -f&lt;br /&gt; g:\istools\shutdown -m \\%target% -t 300 -r -f&lt;br /&gt; ECHO %TARGET%: To Be Rebooted! (%NU_Product type%)&gt;&gt; F:\UPTIME.TXT&lt;br /&gt;:: REBOOT CODE&lt;br /&gt;:NOREBOOT&lt;br /&gt;&lt;br /&gt;:: ---------------------------------------------------&lt;br /&gt;:: PAYLOAD &lt;span style="background-color: rgb(255, 153, 51);"&gt; 8 &lt;/span&gt;&lt;br /&gt;:: ---------------------------------------------------&lt;br /&gt;&lt;br /&gt;goto end&lt;br /&gt;&lt;br /&gt;:SetVars  &lt;span style="background-color: rgb(255, 153, 51);"&gt; 9 &lt;/span&gt;&lt;br /&gt;SET VAR=%~1&lt;br /&gt;SET VALUE=%~2&lt;br /&gt;REM echo **NU_%W1%**&lt;br /&gt;:TRIMLEAD&lt;br /&gt;IF "%VALUE%"=="" SET VAR=&amp;GOTO :eof&lt;br /&gt;IF "%VALUE:~0,1%"==" " SET VALUE=%VALUE:~1%&amp;amp;goto TrimLead&lt;br /&gt;ECHO %VAR%=%VALUE%&lt;br /&gt;SET NU_%VAR%=%VALUE%&lt;br /&gt;goto :eof&lt;br /&gt;&lt;br /&gt;:end&lt;br /&gt;:NOTPRESENT&lt;br /&gt;echo done&lt;br /&gt;color&lt;br /&gt;IF /I "%BATCHMODE%"=="ON" exit &lt;span style="background-color: rgb(255, 153, 51);"&gt; 10 &lt;/span&gt; &lt;/pre&gt;  &lt;table summary="" border="0" cellpadding="3" cellspacing="3"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign="top"&gt;          &lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt; &lt;span style="background-color: rgb(255, 153, 51);"&gt; 1 &lt;/span&gt;&lt;/td&gt; &lt;td&gt;Set this to a difference code so it's easy to find the files.&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt; &lt;span style="background-color: rgb(255, 153, 51);"&gt; 2 &lt;/span&gt;&lt;/td&gt; &lt;td&gt;Don't reboot the computer you're running this on.&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt; &lt;span style="background-color: rgb(255, 153, 51);"&gt; 3 &lt;/span&gt;&lt;/td&gt; &lt;td&gt;Check to be sure the target is available.&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt; &lt;span style="background-color: rgb(255, 153, 51);"&gt; 4 &lt;/span&gt;&lt;/td&gt; &lt;td&gt;Check to be sure you're not targetting a server (or are if you wanna get fired). Calling SetVars (&lt;span style="background-color: rgb(255, 153, 51);"&gt; 9 &lt;/span&gt;) captures the variables you'll need.&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt; &lt;span style="background-color: rgb(255, 153, 51);"&gt; 5 &lt;/span&gt;&lt;/td&gt; &lt;td&gt;This first checks to see if the system has been rebooted recently, if it has, no need to interfere again.&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt; &lt;span style="background-color: rgb(255, 153, 51);"&gt; 6 &lt;/span&gt;&lt;/td&gt; &lt;td&gt;This is the file you're checking for, this may be more complex than looking at the existence of a file, but the test can go here. If you haven't created a place to save the logs the folder is created (20051108) and the date and time is logged to a file. This is a manner of validation for the process.&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt; &lt;span style="background-color: rgb(255, 153, 51);"&gt; 7 &lt;/span&gt;&lt;/td&gt; &lt;td&gt;While there are a couple of versions of SHUTDOWN.EXE, please make sure your versions parameters are correct. If not time, embarrassement is saved when you test thoroughly.&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt; &lt;span style="background-color: rgb(255, 153, 51);"&gt; 8 &lt;/span&gt;&lt;/td&gt; &lt;td&gt;This may be additional actions. I haven't used this, but you can deliver files or registry settings here if required.&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt; &lt;span style="background-color: rgb(255, 153, 51);"&gt; 9 &lt;/span&gt;&lt;/td&gt; &lt;td&gt;This is the procedure to capture various settings on your target system. The output of PSINFO.EXE (from &lt;a href="http://sysinternals.com/" target="_new"&gt;sysinternals.com&lt;/a&gt;) is processed into environment variables. It also Trims Leading characters to ensure the data is relatively clean.&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt; &lt;span style="background-color: rgb(255, 153, 51);"&gt; 10 &lt;/span&gt;&lt;/td&gt; &lt;td&gt;This is a catch all that allows the code to exist if it's shelled from another batch file.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-3294894971919873402?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/3294894971919873402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=3294894971919873402' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/3294894971919873402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/3294894971919873402'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2005/10/search-and-destroy.html' title='Search and Destroy'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6932839032613249389.post-754955651679349409</id><published>2005-01-09T07:16:00.000-05:00</published><updated>2006-10-09T07:16:01.063-04:00</updated><title type='text'>COMMAND Scripted Tools for Network Administration</title><content type='html'>&lt;p&gt;This is a very long post, sorry.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The  following  are  tools  useful in performing Security or Administrative functions,  they  consist of Windows2000 or WindowsNT Resource Kit tools  wrapped into CMD (batch) files. Please use all due care when connecting to remote systems to minimize impact and risks. You must acquire the Resource Kits on your own.&lt;/p&gt; &lt;hr color="#999999" noshade="noshade" size="1"&gt; &lt;h2&gt;CMD: Finding a PC on the network.&lt;/h2&gt; &lt;p&gt;This  uses  the  NET command to find a machine matching criteria. If you're looking  for  Bob Jackson's  computer (JACKSONB01) you might type 'FINDSYS jack' to return a list. If you do not include a parameter, it will prompt for the partial.   &lt;/p&gt;  &lt;pre&gt;&lt;b&gt;FINDSYS.CMD&lt;/b&gt;&lt;br /&gt;@echo off&lt;br /&gt;SET userid=%1&lt;br /&gt;if "%userid%" == "" SET /P userid=Please enter the users ID or partial:&lt;br /&gt;net view | find /I "%userid%" &gt; %temp%\finduser.txt&lt;br /&gt;start notepad %temp%\finduser.txt&lt;br /&gt;&lt;/pre&gt;   &lt;h2&gt;CMD: Creating an User's Network Drive (F:)&lt;/h2&gt; &lt;p&gt;This tool was created because the administrative function of creating an F Drive takes time best spent doing other things. The user must already exist, but after the creation of the user, this process takes only seconds and can be given to anyone with authority to resolve problems or oversights.&lt;/p&gt;  &lt;pre&gt;&lt;b&gt;CREATEF.CMD&lt;/b&gt;&lt;br /&gt;@echo off&lt;br /&gt;IF "%1" == "" GOTO SYNTAX&lt;br /&gt;IF "%2" == "" GOTO SYNTAX&lt;br /&gt;showgrps tcidmnnt\%1 | FIND /i "Invalid User Specified"&lt;br /&gt;if errorlevel == 1 goto userfound&lt;br /&gt;goto nouser&lt;br /&gt;:userfound&lt;br /&gt;mkdir \\&lt;i&gt;servername&lt;/i&gt;\f$\users\%1&lt;br /&gt;&lt;b&gt;cacls&lt;/b&gt; \\&lt;i&gt;servername&lt;/i&gt;\f$\users\%1 /E  /G %1:F&lt;br /&gt;&lt;b&gt;rmtshare&lt;/b&gt;   \\servername\%1=f:\users\%1&lt;br /&gt;  /GRANT everyone:"Full  Control"&lt;br /&gt;  /REMARK:"by %username% on V#:%2"&lt;br /&gt;DATE /T &gt;&gt; "\\&lt;i&gt;servername&lt;/i&gt;\userdata\support\FDRIVE.LOG"&lt;br /&gt;TIME /T &gt;&gt; "\\&lt;i&gt;servername&lt;/i&gt;\userdata\support\FDRIVE.LOG"&lt;br /&gt;echo Create F: Drive: %2 %1 &gt;&gt; "\\servername\userdata\support\FDRIVE.LOG"&lt;br /&gt;echo Done.&lt;br /&gt;&lt;b&gt;showacls&lt;/b&gt; \\&lt;i&gt;servername&lt;/i&gt;\f$\users\%1&lt;br /&gt;goto end&lt;br /&gt;:SYNTAX&lt;br /&gt;echo Please use syntax: createf.cmd userid ticket#&lt;br /&gt;goto end&lt;br /&gt;:nouser&lt;br /&gt;echo ERROR: User (%1) not found.&lt;br /&gt;goto end&lt;br /&gt;:end&lt;br /&gt;pause&lt;br /&gt;&lt;/pre&gt;   &lt;p&gt;This  tool  can  be used from the Start.Run or command-line and will create the  F drive for a new user. You may need to wait a 1/2 hour for the server to  know  who the new user is after creation. The Syntax is 'CREATEF userid 00000'  where  00000  is the Help Desk Ticket number. This requires Domain Admin or equivelant rights on the server and access to the following NT/NT Resource Kit tools: cacls.exe, rmtshare.exe, showgrps.exe&lt;/p&gt;  &lt;h2&gt;CMD: Make Remote Shares&lt;/h2&gt; &lt;p&gt;Occationally I need to access a system that does not have the default shares (C$, D$, etc.). To make the connection process simple MKSHARES.CMD will establish the shares temporarily (until next re-boot). The syntax is 'MKSHARES computername'. Some machines do not have a D:, E, or Y: drive but the drives that do exist are created.&lt;/p&gt;   &lt;pre&gt;&lt;b&gt;MKSHARES.CMD&lt;/b&gt;&lt;br /&gt;@echo off&lt;br /&gt;rmtshare \\%1\c$=c:\&lt;br /&gt;rmtshare \\%1\d$=d:\&lt;br /&gt;rmtshare \\%1\e$=e:\&lt;br /&gt;rmtshare \\%1\y$=y:\&lt;br /&gt;&lt;/pre&gt;  &lt;h2&gt;F Drive Clean Up Tool.&lt;/h2&gt; &lt;p&gt;This  is  a  tool  designed to let you find those old and unused folders of users  long  gone.  It checks the 'Domain Users' membership and reports the folders that don't exist as accounts.&lt;/p&gt;  &lt;pre&gt;&lt;b&gt;KLEENUP.CMD&lt;/b&gt;&lt;br /&gt;@echo off&lt;br /&gt;Title F Drive Kleen-Up&lt;br /&gt;echo Querying Domain...&lt;br /&gt;echo Folders without Users &gt; fldrlist.txt&lt;br /&gt;&lt;b&gt;showmbrs&lt;/b&gt;   tcidmnnt\domain  users  |  &lt;span style="background-color: rgb(0, 204, 102);"&gt;~SPLIT LINE~&lt;/span&gt;&lt;br /&gt;FIND  /V  "$"  |  SORT  /O  %TEMP%&lt;br /&gt;\DOMAINU.TXT&lt;br /&gt;echo Checking F Drives...&lt;br /&gt;dir \\&lt;i&gt;servername&lt;/i&gt;\f$\users /a:d /b &gt; %TEMP%\usrfldrs.txt&lt;br /&gt;echo Analyzing...&lt;br /&gt;for /f %%u in (%TEMP%\usrfldrs.txt) do call &lt;b&gt;chk4usr&lt;/b&gt; %%u&lt;br /&gt;cls&lt;br /&gt;start notepad fldrlist.txt&lt;br /&gt;start \\&lt;i&gt;servername&lt;/i&gt;\f$\users&lt;br /&gt;&lt;/pre&gt;   &lt;pre&gt;&lt;b&gt;CHK4USR.CMD&lt;/b&gt;&lt;br /&gt;@echo off&lt;br /&gt;type %TEMP%\DOMAINU.TXT| FIND /I "%1"&lt;br /&gt;IF ERRORLEVEL 1 GOTO NOTFOUND&lt;br /&gt;GOTO END&lt;br /&gt;:NOTFOUND&lt;br /&gt;echo %1 (Extra Folder)&lt;br /&gt;echo %1 &gt;&gt; fldrlist.txt&lt;br /&gt;GOTO END&lt;br /&gt;:END&lt;br /&gt;&lt;/pre&gt;  &lt;h2&gt;CMD: Checking a Remote Computer for Welchia Virus&lt;/h2&gt; &lt;p&gt;This  is  more  for  Virus Hunting. When checking a remote machine that has been acting like a host to the Welchia virus, this tool will help determine the  virus'  presence  in a non-invasive manner. Once the presence has been determined  the  removal  can  proceed through remote control and or manual removal.  There  is  a  need  for the NT Resource Kit tool, rmtshare.exe to allow this to work. Please ensure this is in the SystemRoot folder. The tags  'found1' and 'found2' represent different strains of Welchia, the latest  hitting mid-February. &lt;/p&gt;  &lt;pre&gt;&lt;b&gt;CHK4WELCHIA.CMD&lt;/b&gt;&lt;br /&gt;@echo off&lt;br /&gt;&lt;b&gt;rmtshare&lt;/b&gt; %1\welchia$=c:\winnt\system32&lt;br /&gt;if exist %1\welchia$\wins\*.* goto found1&lt;br /&gt;if exist %1\welchia$\drivers\svchost.exe goto found1&lt;br /&gt;goto end&lt;br /&gt;:found1&lt;br /&gt;dir %1\welchia$\wins\*.*&lt;br /&gt;pause&lt;br /&gt;goto end&lt;br /&gt;:found2&lt;br /&gt;dir %1\welchia$\drivers\svchost.exe&lt;br /&gt;pause&lt;br /&gt;:end&lt;br /&gt;&lt;b&gt;rmtshare&lt;/b&gt; %1\welchia$ /d&lt;br /&gt;&lt;/pre&gt;  &lt;p&gt;Syntax:&lt;br /&gt;CHK4WELCHIA \\computername&lt;/p&gt;  &lt;p&gt;Try this Command line:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;for /F "skip=1" %a in ('net view') do call CHK4WELCHIA %a&lt;br /&gt;&lt;/pre&gt;  &lt;p&gt;This should search through every machione on your network (that's visible with NET VIEW) and test for Welchia. An Alternate and more raw test would be the following:&lt;/p&gt; &lt;pre&gt;for /F "skip=1" %a in ('net view') do IF EXIST &lt;span style="background-color: rgb(0, 204, 102);"&gt;~SPLIT LINE~&lt;/span&gt;&lt;br /&gt;%a\c$\winnt\system32\drivers\svchost.exe echo %a &gt;&gt; E:\targets.txt&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;This logs the hunt to a file. Any infected PC is noted and your staff can hunt these systems down and clean them up. The best protection is a up-to-date antivirus tools.&lt;/p&gt;  &lt;hr color="#999999" noshade="noshade" size="1"&gt; &lt;h2&gt;Duplicating Rights by Group from one user to another&lt;/h2&gt; &lt;p&gt;This is essential to my job as there are moves on a regular basis as rights don't move with people.&lt;/p&gt; &lt;pre&gt;  @echo off&lt;br /&gt;REM SYNTAX: mirror DONOR RECIPIENT&lt;br /&gt;FOR /F "tokens=2,3,4 delims=/ " %%a in ('echo %DATE%') do SET DSTAMP&lt;br /&gt;=%%c-%%a-%%b&lt;br /&gt;echo Preserving Original Group List for %2...&lt;br /&gt;showgrps DOMAINNAME\%2 &gt; E:\ID_%2_ORIG_%DSTAMP%.TXT&lt;br /&gt;echo Obtaining Mirror List from %1...&lt;br /&gt;showgrps DOMAINNAME\%1 &gt; E:\ID_%2_MIRROR_%1_%DSTAMP%.TXT&lt;br /&gt;echo Clearing Current groups for %2...&lt;br /&gt;for /F "skip=1 tokens=1,2 delims=\" %%s in ('type E:&lt;br /&gt;\ID_%2_ORIG_%DSTAMP%.TXT') do (IF "%%s" == "  DOMAINNAME" &lt;span style="background-color: rgb(0, 204, 102);"&gt;~SPLIT LINE~&lt;/span&gt;&lt;br /&gt;echo Removing %2&lt;br /&gt;from "%%t" &amp; net group "%%t" %2 /DELETE /DOMAIN )&lt;br /&gt;echo Mirroring %1 groups for %2...&lt;br /&gt;for /F "skip=1 tokens=1,2 delims=\" %%s in ('type E:&lt;br /&gt;\ID_%2_MIRROR_%1_%DSTAMP%.TXT') do (IF "%%s" == "  DOMAINNAME" &lt;span style="background-color: rgb(0, 204, 102);"&gt;~SPLIT LINE~&lt;/span&gt;&lt;br /&gt;echo Adding %2&lt;br /&gt;to "%%t" &amp; net group "%%t" %2 /ADD /DOMAIN )&lt;br /&gt;&lt;/pre&gt; &lt;hr color="#999999" noshade="noshade" size="1"&gt; &lt;h2&gt;CMD: Connecting to the first available drive letter&lt;/h2&gt; &lt;p&gt;Sometimes you NEED to use a drive, can't use a UNC path, must be a drive. So... Here's a tick that might help.&lt;/p&gt; &lt;pre&gt;@echo off&lt;br /&gt;CLS&lt;br /&gt;color 2F&lt;br /&gt;echo Initiating SMS Manual Installation...&lt;br /&gt;SET DRIVE=&lt;br /&gt;FOR /F "tokens=2 delims= " %%x in ('net use * \\SERVERNAME\sharename') do IF&lt;br /&gt;NOT "%%x"=="error" IF NOT "%%x"=="command" IF NOT "%%x"=="network" echo&lt;br /&gt;CONNECTED as %%x&amp;amp;SET DRIVE=%%x&lt;br /&gt;ECHO %DRIVE%&lt;br /&gt;REM DO what you want here...&lt;br /&gt;NET USE %DRIVE% /D /Y&lt;br /&gt;&lt;/pre&gt; &lt;hr color="#999999" noshade="noshade" size="1"&gt; &lt;h2&gt;CMD: Opening a weekly report on a single click - UPDATED!!!!&lt;/h2&gt; &lt;p&gt;The purpose of this batch file is to look for the last status report (Last-Week/This-Week/Next-Week Report or LTN) and open it. The functionality of the batch file counts on your date format being English(United States) but this is easily changed to suit your needs. The process is simple and not perfect but somewhat logical. The file system doesn't really care about the date so we disect it into parts and assign these to the variables YEAR, MONTH, DAY. If the file isn't dated with today's date then we subtract 1 from day and try again. If the day reaches 1 then we set the day to 32, subtract 1 from the month, subtracting 1 from the day again as a matter of logic puts us at 31 and try again. Even if the month has 28 days, this will still work. The COUNTER variable ensures this doesn't go on forever, I figure 10 is enough as a week is 7 days and the most offset from a month-end (31 vs 28) is 3 days.&lt;/p&gt; &lt;p&gt;When I first wrote this I found it didn't subtract properly... the simple answer is don't mess of the math with cosmetics. seperate the calculations from adding the leading zeros and all works fine. &lt;/p&gt; &lt;p&gt;This thing was created because I hate having to look for the file and the filename changes every week. Ya... real lazy. I connect it to an icon and can open my target file in a single click. That I like!&lt;/p&gt; &lt;pre&gt;&lt;b&gt;OpenLTN.CMD&lt;/b&gt;&lt;br /&gt;@echo off&lt;br /&gt;SET DOCPATH=F:\Reports\Weekly&lt;br /&gt;for /f "tokens=2,3,4,5 delims=/ " %%a in ('date /t') do &lt;span style="background-color: rgb(0, 204, 102);"&gt;~SPLIT LINE~&lt;/span&gt;&lt;br /&gt;SET MONTH=%%a&amp;SET DAY=%%b&amp;amp;SET YEAR=%%c&lt;br /&gt;SET COUNTER=0&lt;br /&gt;IF "%DAY%" EQU "08" SET DAY=8&lt;br /&gt;IF "%MONTH%" EQU "08" SET MONTH=8&lt;br /&gt;echo *%MONTH%*&lt;br /&gt;pause&lt;br /&gt;SET /A DDAY=%DAY%+3&lt;br /&gt;SET /A MONTH=%MONTH%&lt;br /&gt;echo %YEAR%-%MONTH%-%DDAY%&lt;br /&gt;SET /A DDAY=%DDAY% + 1&lt;br /&gt;ECHO %DDAY%&lt;br /&gt;ECHO %MONTH%&lt;br /&gt;echo Begin Search...&lt;br /&gt;:START&lt;br /&gt;SET /A MONTH=%MONTH%+0&lt;br /&gt;SET /A DDAY=%DDAY%+0&lt;br /&gt;IF %DDAY% EQU 1  SET DDAY=32&lt;br /&gt;IF %DDAY% EQU 32 SET /A MONTH = %MONTH% - 1&lt;br /&gt;IF %DDAY% GTR 0  SET /A DDAY=%DDAY%-1&lt;br /&gt;SET /A DDAY=%DDAY% * 1&lt;br /&gt;&lt;br /&gt;SET D=%DDAY%&lt;br /&gt;IF %DDAY% LSS 10 SET D=0%DDAY%&lt;br /&gt;&lt;br /&gt;SET M=%MONTH%&lt;br /&gt;IF %MONTH% LSS 10 SET M=0%MONTH%&lt;br /&gt;&lt;br /&gt;SET /A COUNTER=%COUNTER%+1&lt;br /&gt;IF %COUNTER% EQU 60 GOTO NOTFOUND&lt;br /&gt;&lt;br /&gt;echo Checking Date: %YEAR%-%MONTH%-%DDAY% (%YEAR%-%M%-%D%)&lt;br /&gt;if exist "%DOCPATH%\%YEAR%_%M%_%D%.doc" start winword "%DOCPATH%\%YEAR%_%M%_%D%.doc"&lt;br /&gt;if exist "%DOCPATH%\%YEAR%_%M%_%D%.doc" goto end&lt;br /&gt;&lt;br /&gt;Goto START&lt;br /&gt;&lt;br /&gt;:notfound&lt;br /&gt;echo Can't find the blasted file... sorry.&lt;br /&gt;pause&lt;br /&gt;&lt;br /&gt;:end&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6932839032613249389-754955651679349409?l=camstechtricks.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://camstechtricks.blogspot.com/feeds/754955651679349409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6932839032613249389&amp;postID=754955651679349409' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/754955651679349409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6932839032613249389/posts/default/754955651679349409'/><link rel='alternate' type='text/html' href='http://camstechtricks.blogspot.com/2006/10/command-scripted-tools-for-network.html' title='COMMAND Scripted Tools for Network Administration'/><author><name>Cameron Stevens</name><uri>https://profiles.google.com/110895986887328900192</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-0oha3Sk5cO8/AAAAAAAAAAI/AAAAAAAAHu8/1KvrHxkeb_s/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry></feed>
