buffy Posted February 28, 2011 Share Posted February 28, 2011 <html> <head> <title>HTA Test</title> <HTA:APPLICATION ID="objTest" APPLICATIONNAME="HTA Test" SCROLL="no" SINGLEINSTANCE="yes" > </head> <script LANGUAGE="VBScript"> sub OsCheck Dim WshShell : Set WshShell = CreateObject("WScript.Shell") Dim strVer : set strVer = WshShell.exec("%comspec% /c ver") Document.Write(strVer) if strVer = "Windows XP" then CreateObject("WScript.Shell").Run "net use * http://yourserver.com/work/" & UserArea.Value & " /user:domain\" & UserArea.Value & " " & PasswordArea.Value & ">c:\map.txt" ,0, True CreateObject("WScript.Shell").Run "cmd /c net use | find " & chr(34) & UserArea.Value & chr(34) & " >c:\map.txt" ,0, True CreateObject("WScript.Shell").Run "cmd /c FOR /F " & chr(34) & "usebackq delims=: tokens=1" & chr(34) & " %i IN (c:\map.txt) DO start %i:" ,1,True else CreateObject("WScript.Shell").Run "net use * http://yourserver.com/work@SSL/" & UserArea.Value & " /user:domain\" & UserArea.Value & " " & PasswordArea.Value ,0, True CreateObject("WScript.Shell").Run "cmd /c net use | find " & chr(34) & UserArea.Value & chr(34) & " >c:\map.txt" ,0, True CreateObject("WScript.Shell").Run "cmd /c FOR /F " & chr(34) & "usebackq delims=: tokens=1" & chr(34) & " %i IN (c:\map.txt) DO start %i:" ,1,True end if end sub </SCRIPT> <body> Welcome to the AMG remote connection application.<P> Please enter your username here:<P> <input type="text" name="UserArea" size="50"><P> <P> Please enter your password here:<P> <input type="password" name="PasswordArea" size="30"><P> <input id=runbutton class="button" type="button" value="Connect" name="run_button" onClick="OsCheck"> </body> The real problem is I dont know carp about VBS so me+google+monster+wine has left the above mess. The idea is to check OS ver, if XP not to use SSL as it cant support it out of the box. any help would be welcomed. Thanks Buffy. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.