Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script help

Status
Not open for further replies.

Calz

Technical User
Nov 14, 2001
103
FR
Need help with a script that runs in a weird order...

Part of:-

Set InFile = Fso_OpenTextFile(".\input.txt", 1, True)
Set OutFile = Fso_OpenTextFile(".\output.txt", 2, True)
ServerCount=0

Do While InFile.atendofline <> true
CurLine = InFile.ReadLine
If InStr(CurLine,"") Then
OutFile.writeline "before"
WshShell.Run ComSpec & " /c .\Binary\psservice \\" & CurLine & " config >> .\output.txt"
OutFile.writeline "after"
ServerCount=ServerCount+1
OutFile.writeline curline
OutFile.writeline servercount
End If
loop

I want it to loop through a list from a text file running the PSService exe but what I get is:-

before
after
Server1
1
before
after
SERVER2
2
before
after
SERVER3
3
SERVICE_NAME: AeLookupSvc
Processes application compatibility lookup requests for applications as they are launched.
TYPE : 20 WIN32_SHARE_PROCESS
START_TYPE : 2 AUTO_START
ERROR_CONTROL : 1 NORMAL
BINARY_PATH_NAME : C:\WINDOWS\system32\svchost.exe -k netsvcs
LOAD_ORDER_GROUP :
TAG : 0
DISPLAY_NAME : Application Experience Lookup Service
DEPENDENCIES :
SERVICE_START_NAME: LocalSystem
FAIL_RESET_PERIOD : 5 seconds
FAILURE_ACTIONS : Restart DELAY: 60000 seconds
: Restart DELAY: 60000 seconds

The last bit is the psservice output but I only get it once not 3 times and it's at the end rather than between before and after.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top