[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

VBScript and Windows Clustering

Posted on 2007-04-02
1
Medium Priority
?
603 Views
Last Modified: 2008-01-09
I have a Windows Clustering question.  We have a software application that isn't cluster aware.  All services are running on a mapped SAN drive E:.  When a connection is lost on Production, the E: drive is mapped to the failover, and services go up.  We have a situation where a file needs to be copied from one directory to another before the services are started.  I have written a VBS file to copy the files, but can not figure out how to configure the clustering software to kick off a VBS file.  Any help would be greatly appreciated.  Currently, the cluster group is the E: drive..no aliases to the services.  

I would really like to Map the E: drive, copy the file, then start the services.
VBS file:
Dim objNet
Dim objFSO, objFileCopy, objGuyFile
Dim strFilePath, strDestination

strFilePathprod = "E:\inserver6\etc\node_id_CHWINCL2A\in_hwfp"
strFilePathfail = "E:\inserver6\etc\node_id_CHWINCL2B\in_hwfp"
strDestination ="E:\inserver6\etc\in_hwpf"


Set objNet = CreateObject("WScript.NetWork")
Set FileSystemObject = CreateObject("Scripting.FileSystemObject") 'Create a filesystem
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set Drives = FileSystemObject.Drives 'Create a drives collection
Set objFileCopy = objFSO.GetFile(strFilePathprod)
Set objFileCopy2 = objFSO.GetFile(strFilePathfail)
For Each DiskDrive in Drives
DriveLetter = DiskDrive.DriveLetter
if DriveLetter = "E" then
    mydrive = DriveLetter
end if
Next

Dim strInfo
strInfo = objNet.ComputerName
if strinfo = "CHWINCL2A" and mydrive = "E" then
   
   ' Copy the file to its destination
   objFileCopy.Copy (strDestination)
   WSCript.Echo "Copied to " & strDestination
   Wscript.Quit
else
   ' Copy the file to its destination
   objFileCopy2.Copy (strDestination)
   WSCript.Echo "Copied to " & strDestination
   Wscript.Quit
end if
      
Set objNet = Nothing                    'Destroy the Object to free the Memo

0
Comment
Question by:ntiguy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 8

Accepted Solution

by:
jwarnken earned 1500 total points
ID: 18862030
I do not work with clustering and am taking a stab in the dark based on http://msdn2.microsoft.com/en-us/library/ms952401.aspx 
But it seams that the command line could be modified to launch your script (i.e. cscript clusterfix.vbs)
You would then have to add the command live for your app into your script as well

Sounds simplet but I am sure there are some important considerations that you are aware of being that you work with it more.

Good luck
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows 10 is here and for most admins this means frustration and challenges getting that first working Windows 10 image. As in my previous sysprep articles, I've put together a simple help guide to get you through this process. The aim is to achiev…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question