Need help with a script that runs in a weird order...
Part of:-
Set InFile = FspenTextFile(".\input.txt", 1, True)
Set OutFile = FspenTextFile(".\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.
Part of:-
Set InFile = FspenTextFile(".\input.txt", 1, True)
Set OutFile = FspenTextFile(".\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.