<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lair360 Blog &#187; VBS Scripts</title>
	<atom:link href="http://lair360.co.uk/blog/category/vbs-scripts/feed/" rel="self" type="application/rss+xml" />
	<link>http://lair360.co.uk/blog</link>
	<description></description>
	<lastBuildDate>Sun, 29 Aug 2010 11:46:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>VBScript – Demolish those broken print jobs!</title>
		<link>http://lair360.co.uk/blog/722/vbscript-%e2%80%93-demolish-those-broken-print-jobs/</link>
		<comments>http://lair360.co.uk/blog/722/vbscript-%e2%80%93-demolish-those-broken-print-jobs/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 12:35:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[VBS Scripts]]></category>
		<category><![CDATA[delete print jobs]]></category>
		<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://lair360.co.uk/blog/?p=722</guid>
		<description><![CDATA[Version: 13.1a Revision: 32 Build 12 VBScript – Demolish those broken print jobs! Introduction: when I am at home, I was reading ‘PC magazine’. They are so boring! So, I decided to rip &#8211; them &#8211; up and dip them into the shredder. Soon, it gave me an idea to construct a little script, just [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Version: 13.1a<br />
Revision: 32 Build 12<br />
<br />
VBScript – Demolish those broken print jobs!<br />
<br />
Introduction:</strong> when I am at home, I was reading ‘PC magazine’. They are so boring! So, I decided to rip &#8211; them &#8211; up and dip them into the shredder. Soon, it gave me an idea to construct a little script, just to delete all ‘print jobs’ from a specific printer!<br />
<br />
Pretty straightforward…<br />
<br />
1.] Download “Notepad++” from this website and install it.<br />
<br />
2.] Execute “Notepad++” and copy this script. After that, just save it as a ‘VBScript’ file.<br />
<br />
Example: delete_printjob.vbs</p>
<pre class="brush: vb;">
'Version: 13.1
'Revision: 12 Build 6
'-----------------------
strComputer = &quot;.&quot;
Set objWMIService = GetObject(&quot;winmgmts:&quot; _
    &amp; &quot;{impersonationLevel=impersonate}!\\&quot; &amp; strComputer &amp; &quot;\root\cimv2&quot;)
Set colInstalledPrinters =  objWMIService.ExecQuery _
    (&quot;Select * from Win32_Printer Where Name = 'Lexmark X6100 Series'&quot;)
For Each objPrinter in colInstalledPrinters
    objPrinter.CancelAllJobs()
Next
</pre>
<p>3.] Check your printer for any print jobs.<br />
<br />
See anything?<br />
<br />
<strong>Copyrighted By Lair360</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lair360.co.uk/blog/722/vbscript-%e2%80%93-demolish-those-broken-print-jobs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stop Ms-Outlook from blacklisting your attachments</title>
		<link>http://lair360.co.uk/blog/706/stop-ms-outlook-from-blacklisting-your-attachments/</link>
		<comments>http://lair360.co.uk/blog/706/stop-ms-outlook-from-blacklisting-your-attachments/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 16:18:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[VBS Scripts]]></category>
		<category><![CDATA[attachments]]></category>
		<category><![CDATA[ms outlook]]></category>
		<category><![CDATA[windows registry]]></category>
		<category><![CDATA[windows registry tweaks]]></category>

		<guid isPermaLink="false">http://lair360.co.uk/blog/?p=706</guid>
		<description><![CDATA[Version: 13.1 Revision: 11.2 Revision: 34 Stop Ms-Outlook from blacklisting your attachments Introduction: for those who would like &#8220;Microsoft Outlook&#8221; to allow a specific attachment &#8211; execution, you can use this tutorial to enable an extension. This process is quite simple and you don&#8217;t have to tell anyone to compress a file (Winzip / Winrar) [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Version: 13.1<br />
Revision: 11.2 Revision: 34<br />
<br />
Stop Ms-Outlook from blacklisting your attachments<br />
<img src="http://lair360.co.uk/blog/wp-content/uploads/2009/11/MSOfficev2.png" alt="MSOfficev2" title="MSOfficev2" width="260" height="260" class="alignleft size-full wp-image-707" /><br />
Introduction:</strong> for those who would like &#8220;Microsoft Outlook&#8221; to allow a specific attachment &#8211; execution, you can use this tutorial to enable an extension. This process is quite simple and you don&#8217;t have to tell anyone to compress a file (Winzip / Winrar) and send it to you. This means, you have to download the file, extract the contents and execute the file. But, if you ignore &#8220;Outlook&#8221; security settings, you can unblock an extension from being blacklisted by Microsoft Outlook and directly execute it without wasting your time and working hours.<br />
<br />
<strong>Warning:</strong> before you continue, this tutorial is about modifying your registry. So, please create a backup and store it in a safe place.<br />
<br />
1.] On your Desktop, click: &#8220;Start >> Run >> Type:  Regedit&#8221;<br />
<br />
2.] Wait for the dialogue box and navigate yourself to this directory. But, be careful with your registry if you have a sensitive mouse.<br />
<br />
<strong>- HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security\</strong><br />
<br />
3.] When you&#8217;re in the &#8220;Security&#8221; directory, you&#8217;ll need to modify this strings: Level1Remove (REG_SZ).<br />
<br />
<strong>Level1Remove =&#8221;.mdb;.exe;.bat;.com;&#8221; (without the quotes)</strong><br />
<br />
4.] Click &#8216;OK&#8217; for the changes to take effect. Also, if you have &#8216;Outlook&#8217; opened, just close the application and access your Inbox again.<br />
<br />
<strong>Alternative:</strong> you can use this VBScript, if you don&#8217;t want to touch the Registry.<br />
Just save this script as: &#8220;MS_Outlook_Security.vbs&#8221; and execute it.<br />
<br />
That is all…</p>
<pre class="brush: vb;">
'Author: Lair360
'Version: 31.2 Final v3
'Revision: 85 Build 12
'———————————————————————————-
Const HKEY_CURRENT_USER = &amp;H80000001
strComputer = &quot;.&quot;

Set objReg=GetObject(&quot;winmgmts:{impersonationLevel=impersonate}!\\&quot; &amp; _
    strComputer &amp; &quot;\root\default:StdRegProv&quot;)

strKeyPath = &quot;Software\Microsoft\Office\11.0\Outlook\Security\&quot;
strValueName = &quot;Level1Remove&quot;
'* Add &amp; Replace an extension, from here.
strValue = &quot;.mdb;.exe;.bat;.com;&quot;
'* End Of Modification.
objReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue
WScript.Echo &quot;All Done!&quot;
</pre>
<p>
<strong>Copyrighted By Lair360</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lair360.co.uk/blog/706/stop-ms-outlook-from-blacklisting-your-attachments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VBScript &#8211; Memory capacity analyzer.</title>
		<link>http://lair360.co.uk/blog/673/vbscript-memory-capacity-analyzer/</link>
		<comments>http://lair360.co.uk/blog/673/vbscript-memory-capacity-analyzer/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 23:11:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[VBS Scripts]]></category>
		<category><![CDATA[Windows XP]]></category>
		<category><![CDATA[computer ram]]></category>
		<category><![CDATA[Installed Modules]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://lair360.co.uk/blog/?p=673</guid>
		<description><![CDATA[Version: 13.1b Revision: 34 Build 12 VBScript &#8211; Memory capacity analyzer. Introduction: this VBScript was designed in college. Well&#8230; I was bored to death as I have to wait for my lecturer, just to unlock the door. So, what did I do on my break? I Sat on the floor with my beautiful laptop and [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Version: 13.1b<br />
Revision: 34 Build 12<br />
<br />
VBScript &#8211; Memory capacity analyzer.<br />
<br />
Introduction:</strong> this VBScript was designed in college. Well&#8230; I was bored to death as I have to wait for my lecturer, just to unlock the door. So, what did I do on my break? I Sat on the floor with my beautiful laptop and write this article for everyone to read, study and enjoy!<br />
<br />
Anyway, there is one thing that I need to tell you&#8230;<br />
<br />
Since I am on a private server, I am hosting all of these articles for you to learn. Therefore, you have to support me in some way! This server is not free, you know it! It&#8217;s a lot faster than before because, my services is put to the edge, just for you to succeed &#8211; not to end as a FAILURE!! Finally, to sum it all up&#8230; I have to dish out (proximately) 169 pounds &#8211; every 2 years + SSL encryption (to keep your privacy safe) with a dedicated IP address for better response time. So, please understand that I am doing this for all of you! This money is not for me&#8230; PLEASE understand!<br />
<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
This VBScript will generate a small notice &#8211; board about your memory capacity and for additional free slots.<br />
So, instead of taking out your computer case, you can use this VBScript to check your motherboard for empty slots!<br />
<br />
Pretty cool, Eh?<br />
<br />
1.] Download Notepad++ (http://notepad-plus.sourceforge.net/) from the author’s website and install the application.<br />
<br />
2.] Execute Notepad++ and copy this script. After that, you’ll need to save it as: &#8220;memory_analyzer.vbs&#8221;.<br />
<br />
<strong>Extension: .vbs (vbs file)</strong><br />
<br />
<strong>———— Copy Text —————</strong></p>
<pre class="brush: vb;">
'Version: 1.3a
'Revision: 11 Build: 23
'Author: Lair360 - 2009
------------------------
strComputer = &quot;.&quot; ' Local computer
strMemory = &quot;&quot;
i = 1

set objWMIService = GetObject(&quot;winmgmts:\\&quot; &amp; strComputer &amp; &quot;\root\cimv2&quot;)
set colItems = objWMIService.ExecQuery(&quot;Select * from Win32_PhysicalMemory&quot;)

For Each objItem In colItems
'This area will identify your total memory.
  if strMemory &lt;&gt; &quot;&quot; then strMemory = strMemory &amp; vbcrlf
  strMemory = strMemory &amp;  &quot;Bank&quot; &amp; i &amp; &quot; : &quot; &amp; (objItem.Capacity / 1048576) &amp; &quot; Mb&quot;
  i = i + 1
Next
installedModules = i - 1
'This area will indentify free slots.
Set colItems = objWMIService.ExecQuery(&quot;Select * from Win32_PhysicalMemoryArray&quot;)
For Each objItem in colItems
  totalSlots = objItem.MemoryDevices
    Next
'Reports on your installed memory.
Wscript.echo &quot;Total Slots: &quot; &amp; totalSlots &amp; vbcrlf &amp; _
       &quot;Free Slots: &quot; &amp; (totalSlots - installedModules) &amp; vbcrlf &amp; _
       vbcrlf &amp; &quot;Installed Modules:&quot; &amp; vbcrlf &amp; strMemory
</pre>
<p><strong>———— End —————</strong><br />
<br />
3.] Execute the Script and wait for the dialogue box.<br />
<br />
4.] Enjoy!<br />
<br />
<strong>Copyrighted By Lair360</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lair360.co.uk/blog/673/vbscript-memory-capacity-analyzer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>VBScript &#8211; redirect WSscript into any directory</title>
		<link>http://lair360.co.uk/blog/587/vbscript-redirect-wsscript-into-any-directory/</link>
		<comments>http://lair360.co.uk/blog/587/vbscript-redirect-wsscript-into-any-directory/#comments</comments>
		<pubDate>Wed, 13 May 2009 16:04:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[VBS Scripts]]></category>
		<category><![CDATA[Windows XP]]></category>
		<category><![CDATA[AddQuotes]]></category>
		<category><![CDATA[Chr(34)]]></category>
		<category><![CDATA[strInput]]></category>
		<category><![CDATA[vbs]]></category>
		<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://lair360.co.uk/blog/?p=587</guid>
		<description><![CDATA[Version: 13.1a Revision: 15 Build 16 VBScript &#8211; redirect WSscript into any directory Introduction: yesterday, from work, I was totally boiling! This made everyone in the department a little curious&#8230;they aren’t sure, what happened. But, that is not the point about this article&#8230; This article will help user and IT administrator handle “wscript output” into [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Version: 13.1a<br />
Revision: 15 Build 16<br />
<br />
VBScript &#8211; redirect WSscript into any directory<br />
<br />
Introduction:</strong> yesterday, from work, I was totally boiling! This made everyone in the department a little curious&#8230;they aren’t sure, what happened.<br />
But, that is not the point about this article&#8230;<br />
<br />
This article will help user and IT administrator handle “wscript output” into any directory.<br />
So, the solution is pretty much&#8230;simple&#8230;plain stupid. All we need to do is use: “AddQuotes, StringInput and stringRun” to accomplish this process. However, this will only work on “Windows XP SP2 +”, and, to avoid confusion, please read VBScript for dummies&#8230;<br />
<br />
Bah&#8230;here is the Script! I need to get on with my Novel. But, don’t panic and run off my blog, I am just stressed. That is all&#8230;<br />
<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<br />
<strong>Notes #1:</strong> the function “AddQuotes” takes care of the double quoting issues, by surrounding whatever input (using the “stringInput” argument of the AddQuotes function.), and redirect the commands, using the built in “Chr(34)” function.<br />
<br />
<strong>Notes #2:</strong> for the “%compspec% /c syntax”. That is old school and it’s already shown in Microsoft KB Articles.<br />
<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: vb;">
'Author: Lair360
'Version: 13,6a
'Revision: 14.1 Build 11
'---------------------------------
Set objShell = WScript.CreateObject(&quot;WScript.Shell&quot;)
'You can modify this line only. But, don't modify anything else below &quot;StrRun&quot;.
'---------------------------------
strRun = &quot;%comspec% /c ipconfig.exe &gt; &quot; &amp; AddQuotes(&quot;C:\temp\ipconfig.txt&quot;)
'---------------------------------
objShell.Run strRun, 1, True
Function AddQuotes(strInput)
AddQuotes = Chr(34) &amp; strInput &amp; Chr(34)
End Function
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
Here is another version for you to analyze. But, don&#8217;t get too confuse about it&#8230;<br />
<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: vb;">
'Author: Lair360
'Version: 13,6a
'Revision: 14.1 Build 11
'---------------------------------
On Error Resume Next
Set objShell = WScript.CreateObject(&quot;WScript.Shell&quot;)
'You can modify this line only. But, don't modify anything else below &quot;StrRun&quot;.
'---------------------------------
strRun = &quot;%comspec% /k c: &amp; ipconfig /displaydns &gt; &quot; &amp; AddQuotes(&quot;I:\vbs project\ipconfig.txt&quot;)
'---------------------------------
objShell.Run strRun, 1, True
Function AddQuotes(strInput)
AddQuotes = Chr(34) &amp; strInput &amp; Chr(34)
End Function
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
<strong>Copyrighted By Lair360</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lair360.co.uk/blog/587/vbscript-redirect-wsscript-into-any-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Repair IE7 &#8211; Run Once Problems</title>
		<link>http://lair360.co.uk/blog/582/repair-ie7-run-once-problems/</link>
		<comments>http://lair360.co.uk/blog/582/repair-ie7-run-once-problems/#comments</comments>
		<pubDate>Sat, 09 May 2009 11:03:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[VBS Scripts]]></category>
		<category><![CDATA[Windows Vista]]></category>
		<category><![CDATA[Windows XP]]></category>
		<category><![CDATA[repair ie7]]></category>
		<category><![CDATA[run once error]]></category>
		<category><![CDATA[RunOnceComplete]]></category>

		<guid isPermaLink="false">http://lair360.co.uk/blog/?p=582</guid>
		<description><![CDATA[Version 13.2 Revision: 34 Build 16 Repair IE7 &#8211; Run Once Problems Introduction: yesterday I was hit with this “Run Once Problems”. It made me very angry, as I couldn’t use “Internet Explorer” to update my notebook – security &#8211; patches and drivers. So, I decided to take action and repair this crazy error&#8230; Part [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Version 13.2<br />
Revision: 34 Build 16<br />
<br />
Repair IE7 &#8211; Run Once Problems<br />
<br />
Introduction:</strong> yesterday I was hit with this “Run Once Problems”. It made me very angry, as I couldn’t use “Internet Explorer” to update my notebook – security &#8211; patches and drivers. So, I decided to take action and repair this crazy error&#8230;<br />
<br />
<strong>Part A: Backing up registry library.</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
1.] Before making any changes to your registry library, you’ll need to make a backup of your registries.<br />
<br />
a.] Click on Start >> Run >> Type: Regedit<br />
b.] Export the ‘registry’ as “RunOnceRepair” by clicking on File, Export, and typing “RunOnceRepair”.<br />
But, make sure &#8216;All&#8217; is selected under “Export range&#8217; and click Save.<br />
c.] Use Notepad++ / Notepad and paste theses codes into Notepad.<br />
<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: vb;">
'Version: 21.1a
'Revision: 12 Build 6
'Author: Lair360
'----------------------------------
Dim WSHShell
Set WSHShell = WScript.CreateObject(&quot;WScript.Shell&quot;)
'----------------------------------
'Disable RunOnce on Internet Explorer 7
WSHShell.Regwrite &quot;HKCU\Software\Microsoft\Internet Explorer\Main\RunOnceHasShown&quot;, &quot;1&quot;, &quot;REG_DWORD&quot;
WSHShell.Regwrite &quot;HKCU\Software\Microsoft\Internet Explorer\Main\RunOnceComplete&quot;, &quot;1&quot;, &quot;REG_DWORD&quot;
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
2.] Save the file as “IERunOnceFix.vbs” by clicking on File, Save As, and typing &#8220;IERunOnceFix.vbs&#8221;.<br />
But, don’t forget to set it as “All File” types, under “ANSI” encoding.<br />
<br />
3.] Exit Notepad and execute the script. After that, just reboot your computer and the problem should be solved.<br />
<br />
<strong>Alternative:</strong> if you don&#8217;t want to use VBScripts, you can use this registry code.<br />
But, it&#8217;s up to you&#8230;<br />
<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: xml;">
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
&quot;RunOnceHasShown&quot;=dword:00000001
&quot;RunOnceComplete&quot;=dword:00000001
</pre>
<p><strong>&#8212;End Source Code&#8212;<br />
<br />
Copyrighted by Lair360</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lair360.co.uk/blog/582/repair-ie7-run-once-problems/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>VBScript &#8211; reboot &amp; shutdown computer systems</title>
		<link>http://lair360.co.uk/blog/529/vbscript-reboot-shutdown-computer-systems/</link>
		<comments>http://lair360.co.uk/blog/529/vbscript-reboot-shutdown-computer-systems/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 20:45:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[VBS Scripts]]></category>
		<category><![CDATA[reboot]]></category>
		<category><![CDATA[reboot systems]]></category>
		<category><![CDATA[shutdown]]></category>
		<category><![CDATA[vbs]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[Windows XP]]></category>

		<guid isPermaLink="false">http://lair360.co.uk/blog/?p=529</guid>
		<description><![CDATA[Version: 13.2 Revision: 44 Build 11 VBScript &#8211; reboot &#038; shutdown computer systems Introduction: many users had asked me to create a VBScript, so that they can shutdown their computer, when they are in an airport or other areas. After two days, I’ve managed to complete my script. However, it’s a pain in the neck [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Version: 13.2<br />
Revision: 44 Build 11<br />
<br />
VBScript &#8211; reboot &#038; shutdown computer systems<br />
<br />
Introduction:</strong> many users had asked me to create a VBScript, so that they can shutdown their computer, when they are in an airport or other areas. After two days, I’ve managed to complete my script. However, it’s a pain in the neck to construct one! But, that road is not for you to worry about.<br />
<br />
I take the risk and testing. But, the rest is for you to enjoy!<br />
<br />
1.] Download notepad++ from the original author or from another source.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>http://sourceforge.net/projects/notepad-plus/</p>
<p>http://filehippo.com/download_notepad/</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<br />
2.] Copy this &#8216;VBScript&#8217; source code and save it as a &#8220;.vbs&#8221; extension.<br />
<br />
<strong>VBScript &#8211; Reboot Computer Systems<br />
&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: vb;">
'Version: 12.2
'Revision: 44 Build 22
'Copyrighted by Lair360
'*******************************
Set OpSysSet = GetObject(&quot;winmgmts:{(Shutdown)}!\\.\root\cimv2&quot;).ExecQuery _
(&quot;select * from Win32_OperatingSystem where Primary=true&quot;)

for each OpSys in OpSysSet
OpSys.Reboot()
next
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
<strong>VBScript &#8211; Shutdown Computer Systems<br />
&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: vb;">
'Version: 12.2
'Revision: 44 Build 22
'Copyrighted by Lair360
'*******************************
Set OpSysSet = GetObject(&quot;winmgmts:{(Shutdown)}!\\.\root\cimv2&quot;).ExecQuery _
(&quot;select * from Win32_OperatingSystem where Primary=true&quot;)

for each OpSys in OpSysSet
OpSys.Shutdown()
next
</pre>
<p><strong>&#8212;End Source Code&#8212;</strong><br />
<br />
3.] Activate the script and enjoy it!<br />
<br />
<strong>Copyright By Lair360</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://lair360.co.uk/blog/529/vbscript-reboot-shutdown-computer-systems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eject USB &#8211; Terminate Application</title>
		<link>http://lair360.co.uk/blog/524/eject-usb-terminate-application/</link>
		<comments>http://lair360.co.uk/blog/524/eject-usb-terminate-application/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 15:22:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[VBS Scripts]]></category>
		<category><![CDATA[remove external drive]]></category>
		<category><![CDATA[terminate]]></category>
		<category><![CDATA[terminate process]]></category>
		<category><![CDATA[USB Eject]]></category>
		<category><![CDATA[vbs]]></category>
		<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://lair360.co.uk/blog/?p=524</guid>
		<description><![CDATA[Version: 11.1 Revision: 32 Build 15 Eject USB &#8211; Terminate Application Introduction: when I was working on my project and exit, I would like to eject my external drive. However, there is a problem. If you close an application, most of the memory in that particular application is not freed, so you&#8217;ll have to terminate [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Version: 11.1<br />
Revision: 32 Build 15<br />
<br />
Eject USB &#8211; Terminate Application<br />
<br />
Introduction:</strong> when I was working on my project and exit, I would like to eject my external drive. However, there is a problem.<br />
<br />
If you close an application, most of the memory in that particular application is not freed, so you&#8217;ll have to terminate a process which is / are running inside your USB drive. After that, you can safely eject without rebooting your computer and wasting your time!<br />
<br />
1.] Download notepad++ from the original author or from another source.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>http://sourceforge.net/projects/notepad-plus/</p>
<p>http://filehippo.com/download_notepad/</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<br />
2.] Copy this &#8216;VBScript&#8217; source code and save it as &#8220;process_terminate.vbs&#8221; [without the quotes]. But, you can use other names if you want and keep the extension intact.<br />
<br />
<strong>Advice:</strong> please put this script on your desktop or system tray.<br />
But, don&#8217;t save this script into your external drive! If you do this, there will be conflicts and errors&#8230;<br />
<br />
<strong>Terminate a process application &#038; Eject USB<br />
&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: vb;">
'Version: 34.1
'Revision: 44 Build 22
'Copyrighted by Lair360
'*******************************
Dim arrDrives()
intCount = 0
strComputer = &quot;.&quot;
'*******************************
Set objFSO = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set objWMIService = GetObject(&quot;winmgmts:\\&quot; &amp; strComputer &amp; &quot;\root\cimv2&quot;)
'Finds all removable drives - USB port.
Set colDrives = objWMIService.ExecQuery _
    (&quot;Select * From Win32_LogicalDisk Where DriveType = 2&quot;)

For Each objDrive in colDrives
	ReDim Preserve arrDrives(intCount)
	arrDrives(intCount) = objDrive.DeviceID
	intCount = intCount + 1
Next
'*******************************
'Finds all processes from a specific removable drives
Set objWMIService = GetObject(&quot;winmgmts:\\&quot; &amp; strComputer &amp; &quot;\root\CIMV2&quot;)
Set colItems = objWMIService.ExecQuery(&quot;SELECT * FROM Win32_Process&quot;)
For Each objItem in colItems
	For Each strDrive in arrDrives
		If LCase(Left(objItem.ExecutablePath, 2)) = LCase(strDrive) Then
			set objWMI = GetObject(&quot;winmgmts://&quot; &amp; strComputer)
			set objRootProcess = _
				objWMI.get(&quot;Win32_Process.Handle=&quot; &amp; objItem.ProcessId)
			KillProcessTree objRootProcess
		End If
	Next
Next
'*******************************
Sub KillProcessTree(objProcess)
	'Kills the process and any child processes
	objWQL = &quot;Select * from Win32_Process &quot; _
	&amp; &quot;where ParentProcessID=&quot; &amp; objProcess.Handle
	Set colResults = objWMI.ExecQuery(objWQL)
	For Each ChildProcess in colResults
		KillProcessTree childProcess
	Next
objProcess.Terminate
End Sub
</pre>
<p><strong>&#8212;End Source Code&#8212;<br />
Copyright 2001-2009 Lair360</strong><br />
<br />
4.] Execute the script!<br />
<br />
5.] Done!</p>
]]></content:encoded>
			<wfw:commentRss>http://lair360.co.uk/blog/524/eject-usb-terminate-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VBScript &#8211; Terminate a specific process</title>
		<link>http://lair360.co.uk/blog/512/vbscript-terminate-a-specific-process/</link>
		<comments>http://lair360.co.uk/blog/512/vbscript-terminate-a-specific-process/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 19:52:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[VBS Scripts]]></category>
		<category><![CDATA[Windows XP]]></category>
		<category><![CDATA[Process VBS]]></category>
		<category><![CDATA[terminate]]></category>
		<category><![CDATA[terminate process]]></category>
		<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://lair360.co.uk/blog/?p=512</guid>
		<description><![CDATA[Version: 13.1 Revision: 22 Build 11 VBScript &#8211; Terminate a specific process Introduction: when I was surfing my website and close &#8220;Firefox&#8221;, just to clear my temporary files and system caches, the browser&#8217;s process was stuck and I have to make a small &#8216;Vbscript&#8217; to terminate the following process. This can be done by finding [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Version: 13.1<br />
Revision: 22 Build 11<br />
<br />
VBScript &#8211; Terminate a specific process<br />
<br />
Introduction:</strong> when I was surfing my website and close &#8220;Firefox&#8221;, just to clear my temporary files and system caches, the browser&#8217;s process was stuck and I have to make a small &#8216;Vbscript&#8217; to terminate the following process. This can be done by finding its process ID or its application name.<br />
<br />
1.] Download notepad++ from the original author or from another source.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>http://sourceforge.net/projects/notepad-plus/</p>
<p>http://filehippo.com/download_notepad/</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<br />
2.] Copy this &#8216;VBScript&#8217; source code and save it as &#8220;process_terminate.vbs&#8221; [without the quotes]. But, you can use other names if you want and keep the extension intact.<br />
<br />
<strong>Terminate a process application by name.<br />
&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: vb;">
strComputer = &quot;.&quot;
Set objWMIService = GetObject _
    (&quot;winmgmts:\\&quot; &amp; strComputer &amp; &quot;\root\cimv2&quot;)
Set colProcessList = objWMIService.ExecQuery _
    (&quot;Select * from Win32_Process Where Name = '&lt;name&gt;'&quot;)
For Each objProcess in colProcessList
    objProcess.Terminate()
Next
</pre>
<p><strong>&#8212;End Source Code&#8212;<br />
Copyright 2001-2009 Lair360</strong><br />
<br />
<strong>Terminate a process application by id number.<br />
&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: vb;">
strComputer = &quot;.&quot;
Set objWMIService = GetObject _
    (&quot;winmgmts:\\&quot; &amp; strComputer &amp; &quot;\root\cimv2&quot;)
Set colProcessList = objWMIService.ExecQuery _
    (&quot;Select * from Win32_Process Where ProcessID = &lt;number&gt;&quot;)
For Each objProcess in colProcessList
    objProcess.Terminate()
Next
</pre>
<p><strong>&#8212;End Source Code&#8212;<br />
Copyright 2001-2009 Lair360</strong><br />
<br />
<strong>Warning:</strong> please use this script carefully!<br />
Any mistake could cause your computer &#8211; system to hang, crash or trigger errors.<br />
<br />
3.] replace one of the script&#8217;s &#8220;name&#8221; or &#8220;number&#8221; to terminate a specific process.<br />
<br />
4.] Execute the script!<br />
<br />
5.] Done!</p>
]]></content:encoded>
			<wfw:commentRss>http://lair360.co.uk/blog/512/vbscript-terminate-a-specific-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VBScript &#8211; USB Eject CPL</title>
		<link>http://lair360.co.uk/blog/507/vbscript-usb-eject-cpl/</link>
		<comments>http://lair360.co.uk/blog/507/vbscript-usb-eject-cpl/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 19:56:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[VBS Scripts]]></category>
		<category><![CDATA[USB Eject]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[Win32_USBControllerDevice]]></category>

		<guid isPermaLink="false">http://lair360.co.uk/blog/?p=507</guid>
		<description><![CDATA[Version: 11.1a Revision: 13 Build 6 VBScript &#8211; USB Eject CPL Introduction: this article was a commission by a student from &#8220;Glasgow School of Art&#8221;. The student asked me if I can create a small script to execute &#8216;Windows &#8211; USB Eject CPL&#8217;, so that he could place it on his desktop for fast access [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Version: 11.1a<br />
Revision: 13 Build 6<br />
<br />
VBScript &#8211; USB Eject CPL<br />
<br />
Introduction:</strong> this article was a commission by a student from &#8220;Glasgow School of Art&#8221;.<br />
The student asked me if I can create a small script to execute &#8216;Windows &#8211; USB Eject CPL&#8217;, so that he could place it on his desktop for fast access &#8211; instead of right clicking on the taskbar&#8230;<br />
<br />
1.] Download notepad++ from the original author or from another source.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>http://sourceforge.net/projects/notepad-plus/</p>
<p>http://filehippo.com/download_notepad/</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<br />
2.] Copy this code and insert it into your notepad.<br />
<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: vb;">
'****************************************
'Author: Lair360
'Version: 2.1
'Revision: 11 Build 6
'****************************************
Set WshShell = WScript.CreateObject(&quot;WScript.Shell&quot;)
intReturn = WshShell.Run(&quot;RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll&quot;, 1, TRUE)
</pre>
<p><strong>&#8212;End Source Code&#8212;<br />
Copyright 2001-2009 Lair360</strong><br />
<br />
3.] Save your file as a &#8220;.vbs&#8221; extension.<br />
<br />
4.] Done!</p>
]]></content:encoded>
			<wfw:commentRss>http://lair360.co.uk/blog/507/vbscript-usb-eject-cpl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VBScript &#8211; System Processor Information</title>
		<link>http://lair360.co.uk/blog/452/vbscript-system-processor-information/</link>
		<comments>http://lair360.co.uk/blog/452/vbscript-system-processor-information/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 18:50:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[VBS Scripts]]></category>
		<category><![CDATA[Windows XP]]></category>
		<category><![CDATA[cpu info script]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[system info]]></category>
		<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://lair360.co.uk/blog/?p=452</guid>
		<description><![CDATA[Version: 32.1 Revision: 14 Build 11 VBScript &#8211; System Processor Information Introduction: this little script was designed to collect various information about your computers&#8217; central processing unit. It will then transfer the information to a file called: SyStem_OS.rtf for you to keep; for future analysis. 1.] Download notepad++ from the original author or from a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Version: 32.1<br />
Revision: 14 Build 11<br />
<br />
VBScript &#8211; System Processor Information<br />
<br />
Introduction:</strong> this little script was designed to collect various information about your computers&#8217; central processing unit. It will then transfer the information to a file called: SyStem_OS.rtf for you to keep; for future analysis.<br />
<br />
1.] Download notepad++ from the original author or from a mirror and install the software.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>http://sourceforge.net/projects/notepad-plus/</p>
<p>http://filehippo.com/download_notepad/</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<br />
2.] Copy this &#8220;VBScript&#8221; code and save it as a &#8220;.vbs&#8221; extension.<br />
<br />
<strong>&#8212;Copy Source Code&#8212;</strong></p>
<pre class="brush: vb;">
'Author: Lair360
'Version: 43.2
'Revision: 68 Build 124
'Notes: This script will gather information about your computer CPU processor
'and it will put these information into an RTF file.
'----------------------------------

On Error Resume Next
Set objWMI = _
   GetObject(&quot;winmgmts:{impersonationLevel=impersonate}//./root/cimv2&quot;)
Set colProcesses = objWMI.ExecQuery(&quot;Select * from Win32_Processor&quot;)
	Set objFS = CreateObject(&quot;Scripting.FileSystemObject&quot;)
		Set objNewFile = objFS.CreateTextFile(&quot;SyStem_OS.rtf&quot;)
objNewFile.WriteLine &quot;Process Report -- Date: &quot; &amp; Now() &amp; vbCrLf
For Each objProcess In colProcesses
	objNewFile.WriteLine &quot;Processor: &quot; &amp; objProcess.Name
	objNewFile.WriteLine &quot;Processor ID: &quot; &amp; objProcess.ProcessorId
	objNewFile.WriteLine &quot;ProcessorType: &quot; &amp; objProcess.ProcessorType
	objNewFile.WriteLine &quot;Family: &quot; &amp; objProcess.Family
	objNewFile.WriteLine &quot;Architecture: &quot; &amp; objProcess.Architecture
	objNewFile.WriteLine &quot;Maximum Clock Speed: &quot; &amp; objProcess.MaxClockSpeed
	objNewFile.WriteLine &quot;VoltageCaps: &quot; &amp; objProcess.VoltageCaps
	objNewFile.WriteLine &quot;Socket Designation: &quot; &amp; objProcess.SocketDesignation
	objNewFile.WriteLine &quot;NumberOfLogicalProcessors: &quot; &amp; objProcess.NumberOfLogicalProcessors
	objNewFile.WriteLine &quot;NumberOfCores: &quot; &amp; objProcess.NumberOfCores
	objNewFile.WriteLine &quot;Manufacturer: &quot; &amp; objProcess.Manufacturer
	objNewFile.WriteLine &quot;L2CacheSize: &quot; &amp; objProcess.L2CacheSize
	objNewFile.WriteLine &quot;L2CacheSpeed: &quot; &amp; objProcess.L2CacheSpeed
	objNewFile.WriteLine &quot;L3CacheSize: &quot; &amp; objProcess.L3CacheSize
	objNewFile.WriteLine &quot;L3CacheSpeed: &quot; &amp; objProcess.L3CacheSpeed
   objNewFile.WriteLine _
        &quot;----------------------------------------------&quot;
   objNewFile.WriteLine vbCR

next
objNewFile.Close
'----------------------------------
</pre>
<p><strong>&#8212;End Source Code&#8212;<br />
Copyright 2001-2009 Lair360</strong><br />
<br />
3.] Execute the script and have fun checking your CPU infos!<br />
<br />
4.] Finish!</p>
]]></content:encoded>
			<wfw:commentRss>http://lair360.co.uk/blog/452/vbscript-system-processor-information/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
