Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'thinkiosk launch on network script
- 'james trevaskis for st doms
- '11/11/2013
- wscript.echo "Please wait while a network connection is established..."
- wscript.echo ""
- 'vars
- Set objShell = WScript.CreateObject("WScript.Shell")
- i=0
- 're-import OPEN profile
- objShell.exec("Netsh wlan add profile filename=c:\windows\stdoms\wireless-open.xml user=all")
- '6 seconds each loop
- for i=1 to 10
- 'recheck port
- processStream
- Next
- 'launching thinkiosk even though no network found
- objShell.exec("c:\program files\thinkiosk\thinkiosk.exe")
- 'objShell.Popup "No network found, you need to establish a network connection then hit the home button"
- Sub processStream
- Set objExecObject = objShell.Exec("c:\windows\stdoms\PortQry.exe -n www.google.com -e 443")
- 'capture stdout
- Do
- line = objExecObject.StdOut.ReadLine()
- s = s & line '& vbcrlf
- Loop While Not objExecObject.Stdout.atEndOfStream
- objString = s
- 'check for failed to resolve (no network)
- compare0 = instr(objString, "Failed to resolve")
- if (compare0 > 0) then
- wscript.echo "Waiting for network connection..."
- if (i = 4) then
- objShell.Exec("explorer.exe shell:::{1fa9085f-25a2-489b-85d4-86326eedcd87}")
- end if
- wscript.sleep 6000
- end if
- 'check for listening string
- compare1 = instr(objString, "LISTENING")
- if (compare1 > 0) then
- 'wscript.echo objString
- 'check for not listening
- compare2 = instr(objString, "NOT LISTENING")
- if (compare2 > 0) then
- wscript.echo "Failed to connect to Citrix..."
- wscript.sleep 6000
- else
- wscript.echo "Connecting to Citrix..."
- strConnected = "1"
- startThinkiosk
- end if
- end if
- End Sub
- sub startThinkiosk
- 'launch thinkiosk
- objShell.exec("c:\program files\thinkiosk\thinkiosk.exe")
- 'exit script
- wscript.quit
- End Sub
Add Comment
Please, Sign In to add comment