WebFocus_Request.vbs ~ .wsf

This proves handy if you're constantly doing EDASTART requests on a server. Takes some of the tedium and repetion out of creating batch requests.

Creative Commons License
WebFocus_Request by Michael T. Bee is licensed under a Creative Commons Attribution 3.0 Unported License.
Based on a work at michaeltbeeitprof.blogspot.com.
Permissions beyond the scope of this license may be available at mailto:michael.t.bee.itprof@gmail.com.

<package>
<job id="WebFocus_Request">
<object id="oFS"
progid="Scripting.FileSystemObject"
/>
<object id="oSh"
progid="WScript.Shell"
/>
<reference object="Scripting.FileSystemObject" />
<reference object="WScript.Shell" />
<script language="vbscript"
src="WebFocus_Request.vbs"
>
</script>
</job>
</package>


OPTION EXPLICIT
'-
' Name: WebFocus_Request.vbs
' Description: Use EDASTART to performs focus requests
' Syntax: CScript WebFocus_Request.wsf /fex:your.fex
'-
Dim bDebug, oArguments, oT3I, sCurDir, sCurDrive, sFEX, sRun
Set oArguments= WScript.Arguments.Named
sFEX=oArguments.Item("FEX")
If sFEX="" Then
WScript.Echo "Expecting one argument FEX:yourfex"
WScript.Quit
End If
'
sCurDir=oSh.CurrentDirectory
sCurDrive=Left(sCurDir,2)
'
Set oT3I=oFS.OpenTextFile(sCurDir & "\" & sFEX & ".t3i",ForWriting,vbTrue)
oT3I.Writeline "%connect"
oT3I.Writeline "%begin"
oT3I.Writeline "EX " & sFex
oT3I.Writeline "%end"
oT3I.Writeline "%disconnect"
oT3I.Writeline "%stop_server"
oT3I.Close
'
sRun= "cmd /c " & _
"(@echo off) && " & _
"(" & sCurDrive & ") && " & _
"(cd " & sCurDir & ") && " & _
"(call e:\ibi\64bit\srv76\wfs\bin\edastart -f " & sFEX & ")"
'
If bDebug Then
sRun=InputBox("sRun?",WScript.ScriptName,sRun)
End If
'
oSh.Run sRun, 4, vbTrue

No comments:

Favorite Tweets