<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[Windows Scripting Forums - All Forums]]></title>
		<link>http://www.windowsscript.com/forums/</link>
		<description><![CDATA[Windows Scripting Forums - http://www.windowsscript.com/forums]]></description>
		<pubDate>Sun, 05 Feb 2012 19:00:25 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[Batch script to copy files !!]]></title>
			<link>http://www.windowsscript.com/forums/Thread-Batch-script-to-copy-files</link>
			<pubDate>Sat, 04 Feb 2012 07:39:32 +0000</pubDate>
			<guid isPermaLink="false">http://www.windowsscript.com/forums/Thread-Batch-script-to-copy-files</guid>
			<description><![CDATA[Hello Frens,<br />
<br />
I have written a small batch script to move the files from two directories to one main directory. It should record all the activities in a log file like files have been moved successfully from directory b to directory A and total number of files moved along with timestamp but its not working. Can you please review and help? Appreciate your help. Also tell me if we can automate this to run everyday at particular time (between 10pm - 11pm)<br />
<br />
echo "files moving at "%date%-%time%" &gt;&gt; c:\OutputFile.log<br />
move "C:\A\*.*" "C:\Test" &gt;&gt; C:\OutputFile.log<br />
move "C:\B\*.*" "C:\Test" &gt;&gt; C:\OutputFile.log<br />
echo "files moved at "%date%-%time%" &gt;&gt; c:\outputfile.log]]></description>
			<content:encoded><![CDATA[Hello Frens,<br />
<br />
I have written a small batch script to move the files from two directories to one main directory. It should record all the activities in a log file like files have been moved successfully from directory b to directory A and total number of files moved along with timestamp but its not working. Can you please review and help? Appreciate your help. Also tell me if we can automate this to run everyday at particular time (between 10pm - 11pm)<br />
<br />
echo "files moving at "%date%-%time%" &gt;&gt; c:\OutputFile.log<br />
move "C:\A\*.*" "C:\Test" &gt;&gt; C:\OutputFile.log<br />
move "C:\B\*.*" "C:\Test" &gt;&gt; C:\OutputFile.log<br />
echo "files moved at "%date%-%time%" &gt;&gt; c:\outputfile.log]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Help required on files deleted on external hard drive.]]></title>
			<link>http://www.windowsscript.com/forums/Thread-Help-required-on-files-deleted-on-external-hard-drive</link>
			<pubDate>Wed, 01 Feb 2012 19:27:41 +0000</pubDate>
			<guid isPermaLink="false">http://www.windowsscript.com/forums/Thread-Help-required-on-files-deleted-on-external-hard-drive</guid>
			<description><![CDATA[undefined]]></description>
			<content:encoded><![CDATA[undefined]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Run ini file]]></title>
			<link>http://www.windowsscript.com/forums/Thread-Run-ini-file</link>
			<pubDate>Wed, 09 Nov 2011 01:31:38 +0000</pubDate>
			<guid isPermaLink="false">http://www.windowsscript.com/forums/Thread-Run-ini-file</guid>
			<description><![CDATA[undefined]]></description>
			<content:encoded><![CDATA[undefined]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Automation Can't Create Object]]></title>
			<link>http://www.windowsscript.com/forums/Thread-Automation-Can-t-Create-Object</link>
			<pubDate>Thu, 03 Nov 2011 08:50:21 +0000</pubDate>
			<guid isPermaLink="false">http://www.windowsscript.com/forums/Thread-Automation-Can-t-Create-Object</guid>
			<description><![CDATA[Hi,<br />
<br />
I have a number of JavaScript files which are used to convert .CSV into .XML. These work perfectly on my 32bit Windows 7 laptop. However, I have just upgraded to a 64bit desktop and want to be able to run the conversion files on there but every time I attempt to run I get the Automation Can't Create Object error. <br />
<br />
I believe it has something to do with the DLL's but I am not competant enought to be able to make the changes/register the required dll's.<br />
<br />
Does anyone know and able to give me a step by step process of what I need to do to get this to work?<br />
<br />
Cheers<br />
<br />
(I've attached one of the Javascript files to the thread)<br /><!-- start: postbit_attachments_attachment -->
<br /><img src="images/attachtypes/js.gif" border="0" alt=".js" />&nbsp;&nbsp;<a href="attachment.php?aid=8" target="_blank">SupplierAssignment.js</a> (Size: 4.6 KB / Downloads: 1)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[Hi,<br />
<br />
I have a number of JavaScript files which are used to convert .CSV into .XML. These work perfectly on my 32bit Windows 7 laptop. However, I have just upgraded to a 64bit desktop and want to be able to run the conversion files on there but every time I attempt to run I get the Automation Can't Create Object error. <br />
<br />
I believe it has something to do with the DLL's but I am not competant enought to be able to make the changes/register the required dll's.<br />
<br />
Does anyone know and able to give me a step by step process of what I need to do to get this to work?<br />
<br />
Cheers<br />
<br />
(I've attached one of the Javascript files to the thread)<br /><!-- start: postbit_attachments_attachment -->
<br /><img src="images/attachtypes/js.gif" border="0" alt=".js" />&nbsp;&nbsp;<a href="attachment.php?aid=8" target="_blank">SupplierAssignment.js</a> (Size: 4.6 KB / Downloads: 1)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Launching .FLV movies through HTML]]></title>
			<link>http://www.windowsscript.com/forums/Thread-Launching-FLV-movies-through-HTML</link>
			<pubDate>Wed, 31 Aug 2011 16:17:55 +0000</pubDate>
			<guid isPermaLink="false">http://www.windowsscript.com/forums/Thread-Launching-FLV-movies-through-HTML</guid>
			<description><![CDATA[undefined]]></description>
			<content:encoded><![CDATA[undefined]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[send mail script problem]]></title>
			<link>http://www.windowsscript.com/forums/Thread-send-mail-script-problem</link>
			<pubDate>Thu, 12 May 2011 19:22:08 +0000</pubDate>
			<guid isPermaLink="false">http://www.windowsscript.com/forums/Thread-send-mail-script-problem</guid>
			<description><![CDATA[I need a "send mail script".<br />
I've found this in Microsoft' website:<br />
<br />
<div class="codeblock">
<div class="title">Code:<br />
</div><div class="body" dir="ltr"><code>Set objEmail = CreateObject("CDO.Message") <br />
set objConf = CreateObject("CDO.Configuration") <br />
&nbsp;&nbsp;<br />
Set objFlds = objConf.Fields <br />
With objFlds <br />
&nbsp;&nbsp;.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 <br />
&nbsp;&nbsp;.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "XXX-ex100" <br />
&nbsp;&nbsp;.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 <br />
&nbsp;&nbsp;'.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic <br />
&nbsp;&nbsp;.Update <br />
End With <br />
Set objEmail.Configuration = objConf <br />
&nbsp;&nbsp;<br />
objEmail.From = "ron.nixon@fastmail.us" <br />
objEmail.To = "users.name@abc.com" <br />
objEmail.Subject = "All done!" <br />
objEmail.Textbody = "...here you go..." <br />
objEmail.Addattachment "C:&#92;directory name of file&#92;filename" <br />
objEmail.Send</code></div></div>
<br />
I've adjusted it for my needings:<br />
- changed smtpserver<br />
- changed smtpserverport<br />
- changed "From" field<br />
- changed "To" Field<br />
- removed "Addattachment" to lower variables number<br />
<br />
Is there any thing left?<br />
What I've to set for "smtpauthenticate" and "objEmail.Configuration"?<br />
<br />
I get this error:<br />
<div class="codeblock">
<div class="title">Code:<br />
</div><div class="body" dir="ltr"><code>---------------------------<br />
Windows Script Host<br />
---------------------------<br />
Script:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:&#92;Documents and Settings&#92;tizio&#92;Desktop&#92;script&#92;MioSendCDOEmail.vbs<br />
Line:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 20<br />
Column:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1<br />
Error:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The transport couldn't connect to the server.<br />
<br />
Code:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 80040213<br />
Origin:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDO.Message.1<br />
<br />
---------------------------<br />
OK&nbsp;&nbsp; <br />
---------------------------</code></div></div>
<br />
I've to send many small files from some computer to the same computer, so I've created a folder with same name and path on every computer; everyday the needed things are put in that folder.<br />
There's this script which send all files from that place to my computer, then another one who erase all files, so the folder will clean for the day after, to avoid duplicates.<br />
<br />
All involved operative systems are Windows XP 32 bit, I don't want to add things such as program, libraries and so on; I want to obtain what I need with standard equipment.<br />
If there are better script languages available (in the standard system) it's ok for me.<br />
<br />
It's ok also if there are other ways to receive, as ftp or whatever.]]></description>
			<content:encoded><![CDATA[I need a "send mail script".<br />
I've found this in Microsoft' website:<br />
<br />
<div class="codeblock">
<div class="title">Code:<br />
</div><div class="body" dir="ltr"><code>Set objEmail = CreateObject("CDO.Message") <br />
set objConf = CreateObject("CDO.Configuration") <br />
&nbsp;&nbsp;<br />
Set objFlds = objConf.Fields <br />
With objFlds <br />
&nbsp;&nbsp;.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 <br />
&nbsp;&nbsp;.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "XXX-ex100" <br />
&nbsp;&nbsp;.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 <br />
&nbsp;&nbsp;'.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic <br />
&nbsp;&nbsp;.Update <br />
End With <br />
Set objEmail.Configuration = objConf <br />
&nbsp;&nbsp;<br />
objEmail.From = "ron.nixon@fastmail.us" <br />
objEmail.To = "users.name@abc.com" <br />
objEmail.Subject = "All done!" <br />
objEmail.Textbody = "...here you go..." <br />
objEmail.Addattachment "C:&#92;directory name of file&#92;filename" <br />
objEmail.Send</code></div></div>
<br />
I've adjusted it for my needings:<br />
- changed smtpserver<br />
- changed smtpserverport<br />
- changed "From" field<br />
- changed "To" Field<br />
- removed "Addattachment" to lower variables number<br />
<br />
Is there any thing left?<br />
What I've to set for "smtpauthenticate" and "objEmail.Configuration"?<br />
<br />
I get this error:<br />
<div class="codeblock">
<div class="title">Code:<br />
</div><div class="body" dir="ltr"><code>---------------------------<br />
Windows Script Host<br />
---------------------------<br />
Script:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:&#92;Documents and Settings&#92;tizio&#92;Desktop&#92;script&#92;MioSendCDOEmail.vbs<br />
Line:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 20<br />
Column:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1<br />
Error:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The transport couldn't connect to the server.<br />
<br />
Code:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 80040213<br />
Origin:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDO.Message.1<br />
<br />
---------------------------<br />
OK&nbsp;&nbsp; <br />
---------------------------</code></div></div>
<br />
I've to send many small files from some computer to the same computer, so I've created a folder with same name and path on every computer; everyday the needed things are put in that folder.<br />
There's this script which send all files from that place to my computer, then another one who erase all files, so the folder will clean for the day after, to avoid duplicates.<br />
<br />
All involved operative systems are Windows XP 32 bit, I don't want to add things such as program, libraries and so on; I want to obtain what I need with standard equipment.<br />
If there are better script languages available (in the standard system) it's ok for me.<br />
<br />
It's ok also if there are other ways to receive, as ftp or whatever.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Why can't I read posts in this forum?]]></title>
			<link>http://www.windowsscript.com/forums/Thread-Why-can-t-I-read-posts-in-this-forum</link>
			<pubDate>Sat, 30 Apr 2011 20:44:55 +0000</pubDate>
			<guid isPermaLink="false">http://www.windowsscript.com/forums/Thread-Why-can-t-I-read-posts-in-this-forum</guid>
			<description><![CDATA[undefined]]></description>
			<content:encoded><![CDATA[undefined]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[powershell not working]]></title>
			<link>http://www.windowsscript.com/forums/Thread-powershell-not-working</link>
			<pubDate>Sat, 30 Apr 2011 13:54:17 +0000</pubDate>
			<guid isPermaLink="false">http://www.windowsscript.com/forums/Thread-powershell-not-working</guid>
			<description><![CDATA[undefined]]></description>
			<content:encoded><![CDATA[undefined]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[MS Word font locked on red]]></title>
			<link>http://www.windowsscript.com/forums/Thread-MS-Word-font-locked-on-red</link>
			<pubDate>Wed, 02 Mar 2011 06:26:29 +0000</pubDate>
			<guid isPermaLink="false">http://www.windowsscript.com/forums/Thread-MS-Word-font-locked-on-red</guid>
			<description><![CDATA[While editing a text document in Word 2007 all keyboard input suddenly changed to RED font. Unable to unlock it with any of usual font changes. Changing font color or 'Theme" choices no help. All other documents are normal. Didn't choose to change font to red but are there any "shortcuts" I might have inadvertently hit? Like CTL + some key? Help.]]></description>
			<content:encoded><![CDATA[While editing a text document in Word 2007 all keyboard input suddenly changed to RED font. Unable to unlock it with any of usual font changes. Changing font color or 'Theme" choices no help. All other documents are normal. Didn't choose to change font to red but are there any "shortcuts" I might have inadvertently hit? Like CTL + some key? Help.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Need code help]]></title>
			<link>http://www.windowsscript.com/forums/Thread-Need-code-help</link>
			<pubDate>Mon, 31 Jan 2011 01:49:03 +0000</pubDate>
			<guid isPermaLink="false">http://www.windowsscript.com/forums/Thread-Need-code-help</guid>
			<description><![CDATA['Formally declare variables used by the script before trying to use them<br />
Dim WshShl, Answer, CardImage<br />
<br />
'Create an instance of the WScript object in order to later use the<br />
'Popup method<br />
Set WshShl = WScript.CreateObject("WScript.Shell")<br />
<br />
'Display the rules of the game<br />
WshShl.Popup "Welcome to Rock, Paper and Scissors game. Here are the " &amp; _<br />
  "rules of the game: 1. Guess the same thing as the computer " &amp; _<br />
  "to tie. 2. Paper covers rock and wins. 3. Rock breaks " &amp; _ <br />
  "scissors and wins. 4. Scissors cut paper and wins."<br />
<br />
'Prompt the user to select a choice<br />
Answer = InputBox("Type Paper, Rock, or Scissors.", _<br />
  "Let's play a game!")<br />
<br />
'Time for the computer to randomly pick a choice<br />
Randomize<br />
GetRandomNumber = Round(FormatNumber(Int((3 * Rnd()) + 1)))<br />
<br />
'Assign a value to the randomly selected number<br />
If GetRandomNumber = 3 then CardImage = "rock"<br />
If GetRandomNumber = 2 then CardImage = "scissor"<br />
If GetRandomNumber = 1 then CardImage = "paper"<br />
<br />
'Display the game's results so that the user can see if he or she won<br />
WshShl.Popup "You picked: " &amp; Answer &amp; Space(12) &amp; "Computer picked: " &amp; _<br />
  CardImage<br />
<br />
If Answer = "rock" &amp; CardImage &lt;&gt; "Paper" then _<br />
MsgBox "Paper Covers Rock:Computer wins!"<br />
<br />
If Answer = "paper" &amp; CardImage &lt;&gt; "Scissors" then MsgBox "Scissors Cuts Paper:Computer wins!"<br />
<br />
If Answer = "scissor" &amp; CardImage &lt;&gt; "rock" then MsgBox "Rock Breaks Scissors:Computer wins!"<br />
<br />
If CardImage = "rock" &amp; Answer &lt;&gt; "Paper" then MsgBox "Paper Covers Rock:You wins!"<br />
<br />
If CardImage = "paper" &amp; Answer&lt;&gt; "Scissors" then MsgBox "Scissors Cuts Paper:You wins!"<br />
<br />
If CardImage = "scissor" &amp; Answer &lt;&gt; "rock" then MsgBox "Rock Breaks Scissors:You wins!"<br />
<br />
If CardImage = "paper" &amp; Answer &lt;&gt; "Paper" then MsgBox "TIE!"<br />
<br />
If CardImage = "scissor" &amp; Answer&lt;&gt; "Scissors" then MsgBox "TIE!"<br />
<br />
If CardImage = "rock" &amp; Answer &lt;&gt; "rock" then MsgBox "TIE!"]]></description>
			<content:encoded><![CDATA['Formally declare variables used by the script before trying to use them<br />
Dim WshShl, Answer, CardImage<br />
<br />
'Create an instance of the WScript object in order to later use the<br />
'Popup method<br />
Set WshShl = WScript.CreateObject("WScript.Shell")<br />
<br />
'Display the rules of the game<br />
WshShl.Popup "Welcome to Rock, Paper and Scissors game. Here are the " &amp; _<br />
  "rules of the game: 1. Guess the same thing as the computer " &amp; _<br />
  "to tie. 2. Paper covers rock and wins. 3. Rock breaks " &amp; _ <br />
  "scissors and wins. 4. Scissors cut paper and wins."<br />
<br />
'Prompt the user to select a choice<br />
Answer = InputBox("Type Paper, Rock, or Scissors.", _<br />
  "Let's play a game!")<br />
<br />
'Time for the computer to randomly pick a choice<br />
Randomize<br />
GetRandomNumber = Round(FormatNumber(Int((3 * Rnd()) + 1)))<br />
<br />
'Assign a value to the randomly selected number<br />
If GetRandomNumber = 3 then CardImage = "rock"<br />
If GetRandomNumber = 2 then CardImage = "scissor"<br />
If GetRandomNumber = 1 then CardImage = "paper"<br />
<br />
'Display the game's results so that the user can see if he or she won<br />
WshShl.Popup "You picked: " &amp; Answer &amp; Space(12) &amp; "Computer picked: " &amp; _<br />
  CardImage<br />
<br />
If Answer = "rock" &amp; CardImage &lt;&gt; "Paper" then _<br />
MsgBox "Paper Covers Rock:Computer wins!"<br />
<br />
If Answer = "paper" &amp; CardImage &lt;&gt; "Scissors" then MsgBox "Scissors Cuts Paper:Computer wins!"<br />
<br />
If Answer = "scissor" &amp; CardImage &lt;&gt; "rock" then MsgBox "Rock Breaks Scissors:Computer wins!"<br />
<br />
If CardImage = "rock" &amp; Answer &lt;&gt; "Paper" then MsgBox "Paper Covers Rock:You wins!"<br />
<br />
If CardImage = "paper" &amp; Answer&lt;&gt; "Scissors" then MsgBox "Scissors Cuts Paper:You wins!"<br />
<br />
If CardImage = "scissor" &amp; Answer &lt;&gt; "rock" then MsgBox "Rock Breaks Scissors:You wins!"<br />
<br />
If CardImage = "paper" &amp; Answer &lt;&gt; "Paper" then MsgBox "TIE!"<br />
<br />
If CardImage = "scissor" &amp; Answer&lt;&gt; "Scissors" then MsgBox "TIE!"<br />
<br />
If CardImage = "rock" &amp; Answer &lt;&gt; "rock" then MsgBox "TIE!"]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[WSH &#x26; VBScript]]></title>
			<link>http://www.windowsscript.com/forums/Thread-WSH-VBScript</link>
			<pubDate>Mon, 31 Jan 2011 01:48:22 +0000</pubDate>
			<guid isPermaLink="false">http://www.windowsscript.com/forums/Thread-WSH-VBScript</guid>
			<description><![CDATA['Formally declare variables used by the script before trying to use them<br />
Dim WshShl, Answer, CardImage<br />
<br />
'Create an instance of the WScript object in order to later use the<br />
'Popup method<br />
Set WshShl = WScript.CreateObject("WScript.Shell")<br />
<br />
'Display the rules of the game<br />
WshShl.Popup "Welcome to Rock, Paper and Scissors game. Here are the " &amp; _<br />
  "rules of the game: 1. Guess the same thing as the computer " &amp; _<br />
  "to tie. 2. Paper covers rock and wins. 3. Rock breaks " &amp; _ <br />
  "scissors and wins. 4. Scissors cut paper and wins."<br />
<br />
'Prompt the user to select a choice<br />
Answer = InputBox("Type Paper, Rock, or Scissors.", _<br />
  "Let's play a game!")<br />
<br />
'Time for the computer to randomly pick a choice<br />
Randomize<br />
GetRandomNumber = Round(FormatNumber(Int((3 * Rnd()) + 1)))<br />
<br />
'Assign a value to the randomly selected number<br />
If GetRandomNumber = 3 then CardImage = "rock"<br />
If GetRandomNumber = 2 then CardImage = "scissor"<br />
If GetRandomNumber = 1 then CardImage = "paper"<br />
<br />
'Display the game's results so that the user can see if he or she won<br />
WshShl.Popup "You picked: " &amp; Answer &amp; Space(12) &amp; "Computer picked: " &amp; _<br />
  CardImage<br />
<br />
If Answer = "rock" &amp; CardImage &lt;&gt; "Paper" then _<br />
MsgBox "Paper Covers Rock:Computer wins!"<br />
<br />
If Answer = "paper" &amp; CardImage &lt;&gt; "Scissors" then MsgBox "Scissors Cuts Paper:Computer wins!"<br />
<br />
If Answer = "scissor" &amp; CardImage &lt;&gt; "rock" then MsgBox "Rock Breaks Scissors:Computer wins!"<br />
<br />
If CardImage = "rock" &amp; Answer &lt;&gt; "Paper" then MsgBox "Paper Covers Rock:You wins!"<br />
<br />
If CardImage = "paper" &amp; Answer&lt;&gt; "Scissors" then MsgBox "Scissors Cuts Paper:You wins!"<br />
<br />
If CardImage = "scissor" &amp; Answer &lt;&gt; "rock" then MsgBox "Rock Breaks Scissors:You wins!"<br />
<br />
If CardImage = "paper" &amp; Answer &lt;&gt; "Paper" then MsgBox "TIE!"<br />
<br />
If CardImage = "scissor" &amp; Answer&lt;&gt; "Scissors" then MsgBox "TIE!"<br />
<br />
If CardImage = "rock" &amp; Answer &lt;&gt; "rock" then MsgBox "TIE!"]]></description>
			<content:encoded><![CDATA['Formally declare variables used by the script before trying to use them<br />
Dim WshShl, Answer, CardImage<br />
<br />
'Create an instance of the WScript object in order to later use the<br />
'Popup method<br />
Set WshShl = WScript.CreateObject("WScript.Shell")<br />
<br />
'Display the rules of the game<br />
WshShl.Popup "Welcome to Rock, Paper and Scissors game. Here are the " &amp; _<br />
  "rules of the game: 1. Guess the same thing as the computer " &amp; _<br />
  "to tie. 2. Paper covers rock and wins. 3. Rock breaks " &amp; _ <br />
  "scissors and wins. 4. Scissors cut paper and wins."<br />
<br />
'Prompt the user to select a choice<br />
Answer = InputBox("Type Paper, Rock, or Scissors.", _<br />
  "Let's play a game!")<br />
<br />
'Time for the computer to randomly pick a choice<br />
Randomize<br />
GetRandomNumber = Round(FormatNumber(Int((3 * Rnd()) + 1)))<br />
<br />
'Assign a value to the randomly selected number<br />
If GetRandomNumber = 3 then CardImage = "rock"<br />
If GetRandomNumber = 2 then CardImage = "scissor"<br />
If GetRandomNumber = 1 then CardImage = "paper"<br />
<br />
'Display the game's results so that the user can see if he or she won<br />
WshShl.Popup "You picked: " &amp; Answer &amp; Space(12) &amp; "Computer picked: " &amp; _<br />
  CardImage<br />
<br />
If Answer = "rock" &amp; CardImage &lt;&gt; "Paper" then _<br />
MsgBox "Paper Covers Rock:Computer wins!"<br />
<br />
If Answer = "paper" &amp; CardImage &lt;&gt; "Scissors" then MsgBox "Scissors Cuts Paper:Computer wins!"<br />
<br />
If Answer = "scissor" &amp; CardImage &lt;&gt; "rock" then MsgBox "Rock Breaks Scissors:Computer wins!"<br />
<br />
If CardImage = "rock" &amp; Answer &lt;&gt; "Paper" then MsgBox "Paper Covers Rock:You wins!"<br />
<br />
If CardImage = "paper" &amp; Answer&lt;&gt; "Scissors" then MsgBox "Scissors Cuts Paper:You wins!"<br />
<br />
If CardImage = "scissor" &amp; Answer &lt;&gt; "rock" then MsgBox "Rock Breaks Scissors:You wins!"<br />
<br />
If CardImage = "paper" &amp; Answer &lt;&gt; "Paper" then MsgBox "TIE!"<br />
<br />
If CardImage = "scissor" &amp; Answer&lt;&gt; "Scissors" then MsgBox "TIE!"<br />
<br />
If CardImage = "rock" &amp; Answer &lt;&gt; "rock" then MsgBox "TIE!"]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[SOLVED] Copy Script]]></title>
			<link>http://www.windowsscript.com/forums/Thread-SOLVED-Copy-Script</link>
			<pubDate>Thu, 13 Jan 2011 14:58:10 +0000</pubDate>
			<guid isPermaLink="false">http://www.windowsscript.com/forums/Thread-SOLVED-Copy-Script</guid>
			<description><![CDATA[Hello maybe someone can help me out as I am desperate,<br />
<br />
This is probably a stupid question, but I am currently trying to write a script that copy’s files from one source directory based on the number of files in the source, to two different directory destinations.  For example if I have 8 files in the source directory (A) I want to copy 4 of the 8 files in destination directory (B) and copy the other 4 files in destination directory &copy;.  I cannot seem to figure this out anywhere!  I currently have this as my script:<br />
<br />
# Created: 1/12/2011<br />
# Purpose: Backup SQL databases to each other <br />
<br />
# Define source directory and destination directory’s to copy files:<br />
&#36;SQL01="C:\Users\Test\Desktop\SQL01Source\"<br />
&#36;DESTSQL02="C:\Users\Test\Desktop\SQL02\"<br />
&#36;DESTSQL03="C:\Users\Test\Desktop\SQL03\"<br />
<br />
# Get Directory items number and divide number received:<br />
(get-childitem &#36;SQL01).count /2<br />
<br />
#Copy Items to Destination folders:<br />
copy-item &#36;SQL01 &#36;DESTSQL02 -recurse <br />
<br />
I am stuck!<br />
<br />
Your help would be greatly appreciated!!!!!<br />
<br />
<br />
Thanks so much,]]></description>
			<content:encoded><![CDATA[Hello maybe someone can help me out as I am desperate,<br />
<br />
This is probably a stupid question, but I am currently trying to write a script that copy’s files from one source directory based on the number of files in the source, to two different directory destinations.  For example if I have 8 files in the source directory (A) I want to copy 4 of the 8 files in destination directory (B) and copy the other 4 files in destination directory &copy;.  I cannot seem to figure this out anywhere!  I currently have this as my script:<br />
<br />
# Created: 1/12/2011<br />
# Purpose: Backup SQL databases to each other <br />
<br />
# Define source directory and destination directory’s to copy files:<br />
&#36;SQL01="C:\Users\Test\Desktop\SQL01Source\"<br />
&#36;DESTSQL02="C:\Users\Test\Desktop\SQL02\"<br />
&#36;DESTSQL03="C:\Users\Test\Desktop\SQL03\"<br />
<br />
# Get Directory items number and divide number received:<br />
(get-childitem &#36;SQL01).count /2<br />
<br />
#Copy Items to Destination folders:<br />
copy-item &#36;SQL01 &#36;DESTSQL02 -recurse <br />
<br />
I am stuck!<br />
<br />
Your help would be greatly appreciated!!!!!<br />
<br />
<br />
Thanks so much,]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Test thread - please ignore]]></title>
			<link>http://www.windowsscript.com/forums/Thread-Test-thread-please-ignore--939</link>
			<pubDate>Fri, 03 Dec 2010 04:56:01 +0000</pubDate>
			<guid isPermaLink="false">http://www.windowsscript.com/forums/Thread-Test-thread-please-ignore--939</guid>
			<description><![CDATA[undefined]]></description>
			<content:encoded><![CDATA[undefined]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Answer &#8220;No to All&#8221; When Copying Files in Windows XP]]></title>
			<link>http://www.windowsscript.com/forums/Thread-Answer-8220-No-to-All-8221-When-Copying-Files-in-Windows-XP</link>
			<pubDate>Thu, 15 Jul 2010 06:03:09 +0000</pubDate>
			<guid isPermaLink="false">http://www.windowsscript.com/forums/Thread-Answer-8220-No-to-All-8221-When-Copying-Files-in-Windows-XP</guid>
			<description><![CDATA[<p>If you&#8217;ve ever copied one directory of files over another, you&#8217;re probably pretty aware that Windows gives you an option to respond Yes To All when file conflicts arise.  But what if you don&#8217;t want to overwrite the files?  Windows Vista and Windows 7 were gracious enough to allow you to repeat your selected action on future conflicts but Windows XP wasn&#8217;t.  Or was it? <a href="http://www.nilpo.com/2010/07/windows-xp/answer-no-to-all-when-copying-files-in-windows-xp/#more-118" class="more-link">(more&#8230;)</a></p>
<br />
<br />
<br />
<br />
Posted on Thu, 15 Jul 2010 05:01:34 +0000 at <a href="http://www.nilpo.com/2010/07/windows-xp/answer-no-to-all-when-copying-files-in-windows-xp/" target="_blank">http://www.nilpo.com/2010/07/windows-xp/...indows-xp/</a><br />
Comments: <a href="http://www.nilpo.com/2010/07/windows-xp/answer-no-to-all-when-copying-files-in-windows-xp/#comments" target="_blank">http://www.nilpo.com/2010/07/windows-xp/.../#comments</a>]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever copied one directory of files over another, you&#8217;re probably pretty aware that Windows gives you an option to respond Yes To All when file conflicts arise.  But what if you don&#8217;t want to overwrite the files?  Windows Vista and Windows 7 were gracious enough to allow you to repeat your selected action on future conflicts but Windows XP wasn&#8217;t.  Or was it? <a href="http://www.nilpo.com/2010/07/windows-xp/answer-no-to-all-when-copying-files-in-windows-xp/#more-118" class="more-link">(more&#8230;)</a></p>
<br />
<br />
<br />
<br />
Posted on Thu, 15 Jul 2010 05:01:34 +0000 at <a href="http://www.nilpo.com/2010/07/windows-xp/answer-no-to-all-when-copying-files-in-windows-xp/" target="_blank">http://www.nilpo.com/2010/07/windows-xp/...indows-xp/</a><br />
Comments: <a href="http://www.nilpo.com/2010/07/windows-xp/answer-no-to-all-when-copying-files-in-windows-xp/#comments" target="_blank">http://www.nilpo.com/2010/07/windows-xp/.../#comments</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Twitter Updates for 2010-07-10]]></title>
			<link>http://www.windowsscript.com/forums/Thread-Twitter-Updates-for-2010-07-10</link>
			<pubDate>Sun, 11 Jul 2010 05:53:49 +0000</pubDate>
			<guid isPermaLink="false">http://www.windowsscript.com/forums/Thread-Twitter-Updates-for-2010-07-10</guid>
			<description><![CDATA[<ul>
<li>Reading: We Can Know! May 21, 2011 is Judgment Day <a href="http://bit.ly/adl71K" rel="nofollow"><a href="http://bit.ly/adl71K" target="_blank">http://bit.ly/adl71K</a></a> by @<a rel="nofollow" href="http://twitter.com/WeCanKnow">WeCanKnow</a>]]></description>
			<content:encoded><![CDATA[<ul>
<li>Reading: We Can Know! May 21, 2011 is Judgment Day <a href="http://bit.ly/adl71K" rel="nofollow"><a href="http://bit.ly/adl71K" target="_blank">http://bit.ly/adl71K</a></a> by @<a rel="nofollow" href="http://twitter.com/WeCanKnow">WeCanKnow</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[I have a complaint.  No, a suggestion!]]></title>
			<link>http://www.windowsscript.com/forums/Thread-I-have-a-complaint-No-a-suggestion</link>
			<pubDate>Thu, 08 Jul 2010 14:36:57 +0000</pubDate>
			<guid isPermaLink="false">http://www.windowsscript.com/forums/Thread-I-have-a-complaint-No-a-suggestion</guid>
			<description><![CDATA[Sure, we'll call it a <span style="font-style: italic;">suggestion</span>:  this forum runs the usual BBCode rules, right?  It would be nice to have some sort of interface or easily accessible list of valid codes.<br />
<br />
I mean, I have a BBCode plugin for my browser that helps a little, but things like <span style="font-size: 24pt;">size</span> and color aren't covered there, and I can't for the life of me remember the valid <span style="color: #660000;">color</span> codes (call me spoiled for being used to an advanced user panel)<br />
<br />
Okay, I lied, size and color are in there...   <img src="http://www.windowsscript.com/forums/images/smilies/tongue.gif" style="vertical-align: middle;" border="0" alt="Tongue" title="Tongue" /><br />
<br />
Oh, and it would be nice if I didn't have to scroll down to hit the 'Post Thread' button.]]></description>
			<content:encoded><![CDATA[Sure, we'll call it a <span style="font-style: italic;">suggestion</span>:  this forum runs the usual BBCode rules, right?  It would be nice to have some sort of interface or easily accessible list of valid codes.<br />
<br />
I mean, I have a BBCode plugin for my browser that helps a little, but things like <span style="font-size: 24pt;">size</span> and color aren't covered there, and I can't for the life of me remember the valid <span style="color: #660000;">color</span> codes (call me spoiled for being used to an advanced user panel)<br />
<br />
Okay, I lied, size and color are in there...   <img src="http://www.windowsscript.com/forums/images/smilies/tongue.gif" style="vertical-align: middle;" border="0" alt="Tongue" title="Tongue" /><br />
<br />
Oh, and it would be nice if I didn't have to scroll down to hit the 'Post Thread' button.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[When's the party?]]></title>
			<link>http://www.windowsscript.com/forums/Thread-When-s-the-party</link>
			<pubDate>Thu, 08 Jul 2010 14:28:57 +0000</pubDate>
			<guid isPermaLink="false">http://www.windowsscript.com/forums/Thread-When-s-the-party</guid>
			<description><![CDATA[So, anything going to happen in here anytime soon?  <img src="http://www.windowsscript.com/forums/images/smilies/tongue.gif" style="vertical-align: middle;" border="0" alt="Tongue" title="Tongue" />]]></description>
			<content:encoded><![CDATA[So, anything going to happen in here anytime soon?  <img src="http://www.windowsscript.com/forums/images/smilies/tongue.gif" style="vertical-align: middle;" border="0" alt="Tongue" title="Tongue" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Looking for guidance in designing a component maintenance tracking DB: OOoBase]]></title>
			<link>http://www.windowsscript.com/forums/Thread-Looking-for-guidance-in-designing-a-component-maintenance-tracking-DB-OOoBase</link>
			<pubDate>Wed, 07 Jul 2010 18:15:12 +0000</pubDate>
			<guid isPermaLink="false">http://www.windowsscript.com/forums/Thread-Looking-for-guidance-in-designing-a-component-maintenance-tracking-DB-OOoBase</guid>
			<description><![CDATA[I have discussions <a href="http://www.devhardware.com/forums/programming-82/database-questions-oobase-hsql-table-creation-305235.html" target="_blank">here</a>, <a href="http://forums.aspfree.com/sql-development-6/question-building-a-database-open-office-base-table-creation-etc-357438.html" target="_blank">here</a> and <a href="http://www.developerbarn.com/database-design-help/2126-looking-guidance-designing-component-maintenance-tracking-db-ooobase.html" target="_blank">here</a>.<br />
<br />
What I <span style="font-style: italic;">want</span> to do is build a tracking database for an item I repair at work:  an aircraft navigational receiver.  There are currently some 19 service bulletins issued by the manufacturer for this unit which address specific issues which have been discovered to be problems or for adding new capability to the units operation.<br />
<br />
A few of these SBs modify the part number of the unit, so I may want to add some constraints later on for data validation purposes.<br />
<br />
Nearly all the SBs are recommended but not mandatory.  However, my employer has recently decided that one particular SB <span style="font-style: italic;">must</span> be installed, and they are giving me a hard time because I can't tell them how many of the 500 or so units we have in our system need to be modified.  Can you imagine how time- and labor-consuming it is to look into the belly of every jet of a regional airline to see if its NAV receivers have a little teeny square on its data plate marked out?<br />
<br />
Anyway, in an effort to prevent this kind of informational gap from occurring again, I want to track the units by part number and serial number (even though they are all the same basic unit, I can't guarantee that there aren't two different part-number models out there with the same serial number), list the service bulletins installed on each, along with part numbers and revision numbers of each of the six major sub-assemblies.  While I am at it, I can also track the Work Orders the units come in on for repair, what I found wrong with them, and what I did to repair them as well as other repairs and maintenance I performed before reissuing them out to the fleet.<br />
<br />
That way, when the boss asks me for high-failure items, or how often a unit can go between alignments, I will be able to issue somewhat accurate statistics.<br />
<br />
Since I use Ubuntu almost exclusively, then my choice of DB app defaults to Open Office.org BASE, which runs on HSQL, apparently.<br />
<br />
I have a script which I wrote to create the tables I think I need, and I am currently thinking about the forms I need to build, but there are still a few issues I have to work out-- what's the best way to track the configuration of each unit (identified by a composite key of unit P/N and S/N)?<br />
<br />
I've thought about using a separate table with the service bulletins (as boolean entities) and indexed with a unique integer primary, but then how would I ensure each index number associates with a unique set of boolean values?<br />
<br />
I thought the most efficient way would be to have a binary-coded hexdecimal number to identify which services bulleting were applied to a unit, but I have no idea how to encode and decode the information through a form (the user would check the appropriate checkboxes and the coded number would be automagically applied to the database and vice-versa).<br />
<br />
I have attached a rough UML I drew up in DIA Diagram Editor.<br />
<br />
I have also attached the SQL script I used to create the latest iteration of my database, but I have done something wrong, I think-- the linking tables aren't updating for me and I have no idea what I need to do to get them to work, nor if there shouldn't be some different way of tracking the data.<br /><!-- start: postbit_attachments_attachment -->
<br /><img src="images/attachtypes/txt.gif" border="0" alt=".txt" />&nbsp;&nbsp;<a href="attachment.php?aid=6" target="_blank">VIR-432 Database script.txt</a> (Size: 2.87 KB / Downloads: 0)
<!-- end: postbit_attachments_attachment --><br /><!-- start: postbit_attachments_attachment -->
<br /><img src="images/attachtypes/zip.gif" border="0" alt=".zip" />&nbsp;&nbsp;<a href="attachment.php?aid=7" target="_blank">VIR-432 UML.dia.zip</a> (Size: 4.24 KB / Downloads: 0)
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[I have discussions <a href="http://www.devhardware.com/forums/programming-82/database-questions-oobase-hsql-table-creation-305235.html" target="_blank">here</a>, <a href="http://forums.aspfree.com/sql-development-6/question-building-a-database-open-office-base-table-creation-etc-357438.html" target="_blank">here</a> and <a href="http://www.developerbarn.com/database-design-help/2126-looking-guidance-designing-component-maintenance-tracking-db-ooobase.html" target="_blank">here</a>.<br />
<br />
What I <span style="font-style: italic;">want</span> to do is build a tracking database for an item I repair at work:  an aircraft navigational receiver.  There are currently some 19 service bulletins issued by the manufacturer for this unit which address specific issues which have been discovered to be problems or for adding new capability to the units operation.<br />
<br />
A few of these SBs modify the part number of the unit, so I may want to add some constraints later on for data validation purposes.<br />
<br />
Nearly all the SBs are recommended but not mandatory.  However, my employer has recently decided that one particular SB <span style="font-style: italic;">must</span> be installed, and they are giving me a hard time because I can't tell them how many of the 500 or so units we have in our system need to be modified.  Can you imagine how time- and labor-consuming it is to look into the belly of every jet of a regional airline to see if its NAV receivers have a little teeny square on its data plate marked out?<br />
<br />
Anyway, in an effort to prevent this kind of informational gap from occurring again, I want to track the units by part number and serial number (even though they are all the same basic unit, I can't guarantee that there aren't two different part-number models out there with the same serial number), list the service bulletins installed on each, along with part numbers and revision numbers of each of the six major sub-assemblies.  While I am at it, I can also track the Work Orders the units come in on for repair, what I found wrong with them, and what I did to repair them as well as other repairs and maintenance I performed before reissuing them out to the fleet.<br />
<br />
That way, when the boss asks me for high-failure items, or how often a unit can go between alignments, I will be able to issue somewhat accurate statistics.<br />
<br />
Since I use Ubuntu almost exclusively, then my choice of DB app defaults to Open Office.org BASE, which runs on HSQL, apparently.<br />
<br />
I have a script which I wrote to create the tables I think I need, and I am currently thinking about the forms I need to build, but there are still a few issues I have to work out-- what's the best way to track the configuration of each unit (identified by a composite key of unit P/N and S/N)?<br />
<br />
I've thought about using a separate table with the service bulletins (as boolean entities) and indexed with a unique integer primary, but then how would I ensure each index number associates with a unique set of boolean values?<br />
<br />
I thought the most efficient way would be to have a binary-coded hexdecimal number to identify which services bulleting were applied to a unit, but I have no idea how to encode and decode the information through a form (the user would check the appropriate checkboxes and the coded number would be automagically applied to the database and vice-versa).<br />
<br />
I have attached a rough UML I drew up in DIA Diagram Editor.<br />
<br />
I have also attached the SQL script I used to create the latest iteration of my database, but I have done something wrong, I think-- the linking tables aren't updating for me and I have no idea what I need to do to get them to work, nor if there shouldn't be some different way of tracking the data.<br /><!-- start: postbit_attachments_attachment -->
<br /><img src="images/attachtypes/txt.gif" border="0" alt=".txt" />&nbsp;&nbsp;<a href="attachment.php?aid=6" target="_blank">VIR-432 Database script.txt</a> (Size: 2.87 KB / Downloads: 0)
<!-- end: postbit_attachments_attachment --><br /><!-- start: postbit_attachments_attachment -->
<br /><img src="images/attachtypes/zip.gif" border="0" alt=".zip" />&nbsp;&nbsp;<a href="attachment.php?aid=7" target="_blank">VIR-432 UML.dia.zip</a> (Size: 4.24 KB / Downloads: 0)
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[HELP: Script for checking sp level in Win 2000/2003 Servers]]></title>
			<link>http://www.windowsscript.com/forums/Thread-HELP-Script-for-checking-sp-level-in-Win-2000-2003-Servers</link>
			<pubDate>Mon, 28 Jun 2010 10:35:38 +0000</pubDate>
			<guid isPermaLink="false">http://www.windowsscript.com/forums/Thread-HELP-Script-for-checking-sp-level-in-Win-2000-2003-Servers</guid>
			<description><![CDATA[Hi Script Guru,<br />
<br />
I need a help for writing a script for finding the service pack installed on a windows 2000 / 2003 server. The condition is I have multiple servers say around 800 servers. Few have Service pack 1 and others have Service pack 2. I need to separate a list of servers which has Sp1 and Sp2. I don't want to login to each server for finding this information.<br />
<br />
I have a script for pinging multiple servers. Where I place the computer names in a text file and fetch the computer name in the script and separate the servers which ping in text file 1 and which do not ping in text file 2. ( I have posted this script in another thread under this section)<br />
<br />
Also I found your idea of using the below script for finding the sp level<br />
<br />
WScript.Echo strOSLongName, strSPLongName<br />
WScript.Echo "Version:", strOSVersion<br />
WScript.Echo "Build:", intBuild<br />
WScript.Echo "Service Pack Level:", intSPMajorVersion<br />
WScript.Echo "SP Version:", strSPVersion <br />
<br />
Its confusing for me in using the above script.<br />
<br />
Can you please post a script that fulfill my requirements?<br />
This might be useful for others too <a href="http://www.windowsscript.com/forums/images/smilies/smile.gif" target="_blank">http://www.windowsscript.com/forums/imag.../smile.gif</a>]]></description>
			<content:encoded><![CDATA[Hi Script Guru,<br />
<br />
I need a help for writing a script for finding the service pack installed on a windows 2000 / 2003 server. The condition is I have multiple servers say around 800 servers. Few have Service pack 1 and others have Service pack 2. I need to separate a list of servers which has Sp1 and Sp2. I don't want to login to each server for finding this information.<br />
<br />
I have a script for pinging multiple servers. Where I place the computer names in a text file and fetch the computer name in the script and separate the servers which ping in text file 1 and which do not ping in text file 2. ( I have posted this script in another thread under this section)<br />
<br />
Also I found your idea of using the below script for finding the sp level<br />
<br />
WScript.Echo strOSLongName, strSPLongName<br />
WScript.Echo "Version:", strOSVersion<br />
WScript.Echo "Build:", intBuild<br />
WScript.Echo "Service Pack Level:", intSPMajorVersion<br />
WScript.Echo "SP Version:", strSPVersion <br />
<br />
Its confusing for me in using the above script.<br />
<br />
Can you please post a script that fulfill my requirements?<br />
This might be useful for others too <a href="http://www.windowsscript.com/forums/images/smilies/smile.gif" target="_blank">http://www.windowsscript.com/forums/imag.../smile.gif</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Script for Pinging multiple servers]]></title>
			<link>http://www.windowsscript.com/forums/Thread-Script-for-Pinging-multiple-servers</link>
			<pubDate>Mon, 28 Jun 2010 10:30:42 +0000</pubDate>
			<guid isPermaLink="false">http://www.windowsscript.com/forums/Thread-Script-for-Pinging-multiple-servers</guid>
			<description><![CDATA[<div class="geshicode_h" style='padding: 5px; background-color: #DFDFDF; border: 1px solid #AAAAAA;'>&nbsp;&nbsp;&nbsp;&nbsp;<a href='#'>VBS Programming</a>
	<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB;'><code><pre class="vbs" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000; font-style: italic;">'===============================================================================&#8203;========================================================</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000; font-style: italic;">'===============================================================================&#8203;========================================================</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000; font-style: italic;">' Ping.vbs</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000; font-style: italic;">' </span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000; font-style: italic;">' Title................ : Script to Ping Machines</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000; font-style: italic;">' </span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000; font-style: italic;">'===============================================================================&#8203;========================================================</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000; font-style: italic;">'===============================================================================&#8203;========================================================</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000; font-style: italic;">'Option Explicit</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00bdff; font-weight: bold;">dim</span> strMsg</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00bdff; font-weight: bold;">dim</span> DateM,DateD,DateY,DateH,DateMi</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00bdff; font-weight: bold;">dim</span> arrySecurityDescriptor</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00bdff; font-weight: bold;">dim</span> objFSO, objTSL,objTSR,objTSN</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00bdff; font-weight: bold;">dim</span> intTargetCnt</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00bdff; font-weight: bold;">dim</span> strComputer,strResult</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00bdff; font-weight: bold;">dim</span> vErrText</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00bdff; font-weight: bold;">dim</span> strListPath,strResultPath</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">strListPath <span style="color: #0000ff; font-weight: bold;">=</span> <span style="color: #800040;">&quot;&quot;</span>     </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">strResultPath <span style="color: #0000ff; font-weight: bold;">=</span> <span style="color: #800040;">&quot;&quot;</span>    </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000099; font-weight: bold;">On Error Resume Next</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000099; font-weight: bold;">Set</span> objFso <span style="color: #0000ff; font-weight: bold;">=</span> <span style="color: #2b91af;">CreateObject</span><span style="color: #009900;">&#40;</span><span style="color: #800040;">&quot;Scripting.FileSystemObject&quot;</span><span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000099; font-weight: bold;">Set</span> objTsL <span style="color: #0000ff; font-weight: bold;">=</span> objFso<span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">OpenTextFile</span><span style="color: #009900;">&#40;</span>strListPath <span style="color: #0000ff; font-weight: bold;">&#x26;</span> <span style="color: #800040;">&quot;computers.txt&quot;</span>,<span style="color: #ff8000;">1</span><span style="color: #009900;">&#41;</span>                    <span style="color: #008000; font-style: italic;">''''File to get the machine list.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000099; font-weight: bold;">Call</span> ErrHandle<span style="color: #009900;">&#40;</span><span style="color: #800040;">&quot;Opening List of Computers - &quot;</span> <span style="color: #0000ff; font-weight: bold;">&#x26;</span> strListPath <span style="color: #0000ff; font-weight: bold;">&#x26;</span> <span style="color: #800040;">&quot;computers.txt&quot;</span><span style="color: #009900;">&#41;</span>   <span style="color: #008000; font-style: italic;">''''Error handling if the file is unable to open.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000099; font-weight: bold;">Set</span> objTsR <span style="color: #0000ff; font-weight: bold;">=</span> objFso<span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">CreateTextFile</span><span style="color: #009900;">&#40;</span>strResultPath <span style="color: #0000ff; font-weight: bold;">&#x26;</span> <span style="color: #800040;">&quot;Alive.txt&quot;</span>,<span style="color: #ff8000;">2</span><span style="color: #009900;">&#41;</span>                      <span style="color: #008000; font-style: italic;">'''''File to store the results for later review.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000099; font-weight: bold;">Call</span> ErrHandle<span style="color: #009900;">&#40;</span><span style="color: #800040;">&quot;Opening Result File - &quot;</span> <span style="color: #0000ff; font-weight: bold;">&#x26;</span> strResultPath <span style="color: #0000ff; font-weight: bold;">&#x26;</span> <span style="color: #800040;">&quot;Alive.txt&quot;</span><span style="color: #009900;">&#41;</span>                 <span style="color: #008000; font-style: italic;">'''''Error handling if the file is unable to open.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000099; font-weight: bold;">Set</span> objTsN <span style="color: #0000ff; font-weight: bold;">=</span> objFso<span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">CreateTextFile</span><span style="color: #009900;">&#40;</span>strResultPath <span style="color: #0000ff; font-weight: bold;">&#x26;</span> <span style="color: #800040;">&quot;NotAlive.txt&quot;</span>,<span style="color: #ff8000;">2</span><span style="color: #009900;">&#41;</span>                 <span style="color: #008000; font-style: italic;">'''''File to store the results for later review.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000099; font-weight: bold;">Call</span> ErrHandle<span style="color: #009900;">&#40;</span><span style="color: #800040;">&quot;Opening Result File - &quot;</span> <span style="color: #0000ff; font-weight: bold;">&#x26;</span> strResultPath <span style="color: #0000ff; font-weight: bold;">&#x26;</span> <span style="color: #800040;">&quot;NotAlive.txt&quot;</span><span style="color: #009900;">&#41;</span>            <span style="color: #008000; font-style: italic;">'''''Error handling if the file is unable to open.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">intTargetCnt <span style="color: #0000ff; font-weight: bold;">=</span> <span style="color: #ff8000;">0</span>          <span style="color: #008000; font-style: italic;">'''''To Check the number of machines processed.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000099; font-weight: bold;">Do</span> <span style="color: #000099; font-weight: bold;">Until</span> objTsL<span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">AtEndOfStream</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> strComputer <span style="color: #0000ff; font-weight: bold;">=</span> objTsL<span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">ReadLine</span>        <span style="color: #008000; font-style: italic;">'''''Getting the computer name.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000099; font-weight: bold;">Set</span> objWMIService <span style="color: #0000ff; font-weight: bold;">=</span> <span style="color: #2b91af;">GetObject</span><span style="color: #009900;">&#40;</span><span style="color: #800040;">&quot;winmgmts:\\.\root\cimv2&quot;</span><span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000099; font-weight: bold;">Set</span> colItems <span style="color: #0000ff; font-weight: bold;">=</span> objWMIService<span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">ExecQuery</span><span style="color: #0000ff; font-weight: bold;"> _</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">     <span style="color: #009900;">&#40;</span><span style="color: #800040;">&quot;Select * from Win32_PingStatus &quot;</span> <span style="color: #0000ff; font-weight: bold;">&#x26; _</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800040;">&quot;Where Address = '&quot;</span> <span style="color: #0000ff; font-weight: bold;">&#x26;</span> strComputer <span style="color: #0000ff; font-weight: bold;">&#x26;</span> <span style="color: #800040;">&quot;'&quot;</span><span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000099; font-weight: bold;">For Each</span> objItem <span style="color: #000099; font-weight: bold;">in</span> colItems</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">     <span style="color: #000099; font-weight: bold;">If</span> objItem<span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">StatusCode</span> <span style="color: #0000ff; font-weight: bold;">=</span> <span style="color: #ff8000;">0</span> <span style="color: #000099; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #008000; font-style: italic;">'WScript.Echo &quot;Reply received.&quot;         </span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <span style="color: #008000; font-style: italic;">'objTsR.WriteLine ()</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  objTsR<span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">WriteLine</span> <span style="color: #009900;">&#40;</span>strComputer<span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <span style="color: #008000; font-style: italic;">'objTsR.WriteLine ()</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">              <span style="color: #000099; font-weight: bold;">Else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #008000; font-style: italic;">'WScript.Echo &quot;No Reply received.&quot;         </span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <span style="color: #008000; font-style: italic;">'objTsN.WriteLine ()</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  objTsN<span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">WriteLine</span> <span style="color: #009900;">&#40;</span>strComputer<span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <span style="color: #008000; font-style: italic;">'objTsN.WriteLine ()</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">             <span style="color: #000099; font-weight: bold;">End</span> <span style="color: #000099; font-weight: bold;">If</span>  </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000099; font-weight: bold;">Next</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000099; font-weight: bold;">Loop</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00bdff; font-weight: bold;">Sub</span> ErrHandle<span style="color: #009900;">&#40;</span>vActivity<span style="color: #009900;">&#41;</span>        <span style="color: #008000; font-style: italic;">'''''Subroutine for handling the error in file operations.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000099; font-weight: bold;">If</span> <span style="color: #808080; font-weight: bold;">err</span> <span style="color: #0000ff; font-weight: bold;">&lt;&gt;</span> <span style="color: #ff8000;">0</span> <span style="color: #000099; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  vErrText <span style="color: #0000ff; font-weight: bold;">=</span> <span style="color: #800040;">&quot;There has been a problem with &quot;</span> <span style="color: #0000ff; font-weight: bold;">&#x26;</span> vActivity</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <span style="color: #808080; font-weight: bold;">wscript</span><span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">echo</span>  vErrText <span style="color: #0000ff; font-weight: bold;">&#x26;</span> <span style="color: #408080; font-weight: bold;">vbcrlf</span> <span style="color: #0000ff; font-weight: bold;">&#x26;</span> <span style="color: #2b91af;">string</span><span style="color: #009900;">&#40;</span><span style="color: #2b91af;">Len</span><span style="color: #009900;">&#40;</span>vErrText<span style="color: #009900;">&#41;</span>,<span style="color: #800040;">&quot;-&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #0000ff; font-weight: bold;">&#x26;</span> <span style="color: #408080; font-weight: bold;">vbcrlf</span> <span style="color: #0000ff; font-weight: bold;">&#x26;</span> <span style="color: #800040;">&quot;Error Number : &quot;</span> <span style="color: #0000ff; font-weight: bold;">&#x26;</span> <span style="color: #808080; font-weight: bold;">err</span><span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">number</span> <span style="color: #0000ff; font-weight: bold;">&#x26;</span> <span style="color: #408080; font-weight: bold;">vbcrlf</span> <span style="color: #0000ff; font-weight: bold;">&#x26;</span> <span style="color: #800040;">&quot; Error Description : &quot;</span> <span style="color: #0000ff; font-weight: bold;">&#x26;</span> <span style="color: #808080; font-weight: bold;">err</span><span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">description</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  CleanUpAndGo</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000099; font-weight: bold;">End</span> <span style="color: #000099; font-weight: bold;">If</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00bdff; font-weight: bold;">End Sub</span></div></li></ol></pre></code></div><br /></div><br />
<br />
-------------------------------------------------------<br />
Save this script in C:\ping folder. <br />
Copy the computer name for which you need to know the ping results in computers.txt file. <br />
Double click on the script . <br />
You will see 2 txt file created in same folder.<br />
One is Alive.txt - Pinging servers<br />
Other one Not- Alive.txt - Not pinging servers]]></description>
			<content:encoded><![CDATA[<div class="geshicode_h" style='padding: 5px; background-color: #DFDFDF; border: 1px solid #AAAAAA;'>&nbsp;&nbsp;&nbsp;&nbsp;<a href='#'>VBS Programming</a>
	<div class="geshicode_b" style='background-color: #FFFFFF; padding-left: 5px; border: 1px solid #BBBBBB;'><code><pre class="vbs" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000; font-style: italic;">'===============================================================================&#8203;========================================================</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000; font-style: italic;">'===============================================================================&#8203;========================================================</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000; font-style: italic;">' Ping.vbs</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000; font-style: italic;">' </span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000; font-style: italic;">' Title................ : Script to Ping Machines</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000; font-style: italic;">' </span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000; font-style: italic;">'===============================================================================&#8203;========================================================</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000; font-style: italic;">'===============================================================================&#8203;========================================================</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000; font-style: italic;">'Option Explicit</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00bdff; font-weight: bold;">dim</span> strMsg</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00bdff; font-weight: bold;">dim</span> DateM,DateD,DateY,DateH,DateMi</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00bdff; font-weight: bold;">dim</span> arrySecurityDescriptor</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00bdff; font-weight: bold;">dim</span> objFSO, objTSL,objTSR,objTSN</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00bdff; font-weight: bold;">dim</span> intTargetCnt</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00bdff; font-weight: bold;">dim</span> strComputer,strResult</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00bdff; font-weight: bold;">dim</span> vErrText</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00bdff; font-weight: bold;">dim</span> strListPath,strResultPath</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">strListPath <span style="color: #0000ff; font-weight: bold;">=</span> <span style="color: #800040;">&quot;&quot;</span>     </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">strResultPath <span style="color: #0000ff; font-weight: bold;">=</span> <span style="color: #800040;">&quot;&quot;</span>    </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000099; font-weight: bold;">On Error Resume Next</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000099; font-weight: bold;">Set</span> objFso <span style="color: #0000ff; font-weight: bold;">=</span> <span style="color: #2b91af;">CreateObject</span><span style="color: #009900;">&#40;</span><span style="color: #800040;">&quot;Scripting.FileSystemObject&quot;</span><span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000099; font-weight: bold;">Set</span> objTsL <span style="color: #0000ff; font-weight: bold;">=</span> objFso<span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">OpenTextFile</span><span style="color: #009900;">&#40;</span>strListPath <span style="color: #0000ff; font-weight: bold;">&</span> <span style="color: #800040;">&quot;computers.txt&quot;</span>,<span style="color: #ff8000;">1</span><span style="color: #009900;">&#41;</span>                    <span style="color: #008000; font-style: italic;">''''File to get the machine list.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000099; font-weight: bold;">Call</span> ErrHandle<span style="color: #009900;">&#40;</span><span style="color: #800040;">&quot;Opening List of Computers - &quot;</span> <span style="color: #0000ff; font-weight: bold;">&</span> strListPath <span style="color: #0000ff; font-weight: bold;">&</span> <span style="color: #800040;">&quot;computers.txt&quot;</span><span style="color: #009900;">&#41;</span>   <span style="color: #008000; font-style: italic;">''''Error handling if the file is unable to open.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000099; font-weight: bold;">Set</span> objTsR <span style="color: #0000ff; font-weight: bold;">=</span> objFso<span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">CreateTextFile</span><span style="color: #009900;">&#40;</span>strResultPath <span style="color: #0000ff; font-weight: bold;">&</span> <span style="color: #800040;">&quot;Alive.txt&quot;</span>,<span style="color: #ff8000;">2</span><span style="color: #009900;">&#41;</span>                      <span style="color: #008000; font-style: italic;">'''''File to store the results for later review.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000099; font-weight: bold;">Call</span> ErrHandle<span style="color: #009900;">&#40;</span><span style="color: #800040;">&quot;Opening Result File - &quot;</span> <span style="color: #0000ff; font-weight: bold;">&</span> strResultPath <span style="color: #0000ff; font-weight: bold;">&</span> <span style="color: #800040;">&quot;Alive.txt&quot;</span><span style="color: #009900;">&#41;</span>                 <span style="color: #008000; font-style: italic;">'''''Error handling if the file is unable to open.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000099; font-weight: bold;">Set</span> objTsN <span style="color: #0000ff; font-weight: bold;">=</span> objFso<span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">CreateTextFile</span><span style="color: #009900;">&#40;</span>strResultPath <span style="color: #0000ff; font-weight: bold;">&</span> <span style="color: #800040;">&quot;NotAlive.txt&quot;</span>,<span style="color: #ff8000;">2</span><span style="color: #009900;">&#41;</span>                 <span style="color: #008000; font-style: italic;">'''''File to store the results for later review.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000099; font-weight: bold;">Call</span> ErrHandle<span style="color: #009900;">&#40;</span><span style="color: #800040;">&quot;Opening Result File - &quot;</span> <span style="color: #0000ff; font-weight: bold;">&</span> strResultPath <span style="color: #0000ff; font-weight: bold;">&</span> <span style="color: #800040;">&quot;NotAlive.txt&quot;</span><span style="color: #009900;">&#41;</span>            <span style="color: #008000; font-style: italic;">'''''Error handling if the file is unable to open.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">intTargetCnt <span style="color: #0000ff; font-weight: bold;">=</span> <span style="color: #ff8000;">0</span>          <span style="color: #008000; font-style: italic;">'''''To Check the number of machines processed.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000099; font-weight: bold;">Do</span> <span style="color: #000099; font-weight: bold;">Until</span> objTsL<span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">AtEndOfStream</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> strComputer <span style="color: #0000ff; font-weight: bold;">=</span> objTsL<span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">ReadLine</span>        <span style="color: #008000; font-style: italic;">'''''Getting the computer name.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000099; font-weight: bold;">Set</span> objWMIService <span style="color: #0000ff; font-weight: bold;">=</span> <span style="color: #2b91af;">GetObject</span><span style="color: #009900;">&#40;</span><span style="color: #800040;">&quot;winmgmts:\\.\root\cimv2&quot;</span><span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000099; font-weight: bold;">Set</span> colItems <span style="color: #0000ff; font-weight: bold;">=</span> objWMIService<span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">ExecQuery</span><span style="color: #0000ff; font-weight: bold;"> _</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">     <span style="color: #009900;">&#40;</span><span style="color: #800040;">&quot;Select * from Win32_PingStatus &quot;</span> <span style="color: #0000ff; font-weight: bold;">& _</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800040;">&quot;Where Address = '&quot;</span> <span style="color: #0000ff; font-weight: bold;">&</span> strComputer <span style="color: #0000ff; font-weight: bold;">&</span> <span style="color: #800040;">&quot;'&quot;</span><span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000099; font-weight: bold;">For Each</span> objItem <span style="color: #000099; font-weight: bold;">in</span> colItems</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">     <span style="color: #000099; font-weight: bold;">If</span> objItem<span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">StatusCode</span> <span style="color: #0000ff; font-weight: bold;">=</span> <span style="color: #ff8000;">0</span> <span style="color: #000099; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #008000; font-style: italic;">'WScript.Echo &quot;Reply received.&quot;         </span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <span style="color: #008000; font-style: italic;">'objTsR.WriteLine ()</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  objTsR<span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">WriteLine</span> <span style="color: #009900;">&#40;</span>strComputer<span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <span style="color: #008000; font-style: italic;">'objTsR.WriteLine ()</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">              <span style="color: #000099; font-weight: bold;">Else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #008000; font-style: italic;">'WScript.Echo &quot;No Reply received.&quot;         </span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <span style="color: #008000; font-style: italic;">'objTsN.WriteLine ()</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  objTsN<span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">WriteLine</span> <span style="color: #009900;">&#40;</span>strComputer<span style="color: #009900;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <span style="color: #008000; font-style: italic;">'objTsN.WriteLine ()</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">             <span style="color: #000099; font-weight: bold;">End</span> <span style="color: #000099; font-weight: bold;">If</span>  </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000099; font-weight: bold;">Next</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000099; font-weight: bold;">Loop</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00bdff; font-weight: bold;">Sub</span> ErrHandle<span style="color: #009900;">&#40;</span>vActivity<span style="color: #009900;">&#41;</span>        <span style="color: #008000; font-style: italic;">'''''Subroutine for handling the error in file operations.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000099; font-weight: bold;">If</span> <span style="color: #808080; font-weight: bold;">err</span> <span style="color: #0000ff; font-weight: bold;">&lt;&gt;</span> <span style="color: #ff8000;">0</span> <span style="color: #000099; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  vErrText <span style="color: #0000ff; font-weight: bold;">=</span> <span style="color: #800040;">&quot;There has been a problem with &quot;</span> <span style="color: #0000ff; font-weight: bold;">&</span> vActivity</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  <span style="color: #808080; font-weight: bold;">wscript</span><span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">echo</span>  vErrText <span style="color: #0000ff; font-weight: bold;">&</span> <span style="color: #408080; font-weight: bold;">vbcrlf</span> <span style="color: #0000ff; font-weight: bold;">&</span> <span style="color: #2b91af;">string</span><span style="color: #009900;">&#40;</span><span style="color: #2b91af;">Len</span><span style="color: #009900;">&#40;</span>vErrText<span style="color: #009900;">&#41;</span>,<span style="color: #800040;">&quot;-&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #0000ff; font-weight: bold;">&</span> <span style="color: #408080; font-weight: bold;">vbcrlf</span> <span style="color: #0000ff; font-weight: bold;">&</span> <span style="color: #800040;">&quot;Error Number : &quot;</span> <span style="color: #0000ff; font-weight: bold;">&</span> <span style="color: #808080; font-weight: bold;">err</span><span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">number</span> <span style="color: #0000ff; font-weight: bold;">&</span> <span style="color: #408080; font-weight: bold;">vbcrlf</span> <span style="color: #0000ff; font-weight: bold;">&</span> <span style="color: #800040;">&quot; Error Description : &quot;</span> <span style="color: #0000ff; font-weight: bold;">&</span> <span style="color: #808080; font-weight: bold;">err</span><span style="color: #0000ff; font-weight: bold;">.</span><span style="color: #b1b100;">description</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  CleanUpAndGo</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #000099; font-weight: bold;">End</span> <span style="color: #000099; font-weight: bold;">If</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00bdff; font-weight: bold;">End Sub</span></div></li></ol></pre></code></div><br /></div><br />
<br />
-------------------------------------------------------<br />
Save this script in C:\ping folder. <br />
Copy the computer name for which you need to know the ping results in computers.txt file. <br />
Double click on the script . <br />
You will see 2 txt file created in same folder.<br />
One is Alive.txt - Pinging servers<br />
Other one Not- Alive.txt - Not pinging servers]]></content:encoded>
		</item>
	</channel>
</rss>
