Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Create single interface to login to multiple sites

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,1279
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Create single interface to login to multiple sites
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Create single interface to login to multiple sites - 8/23/2004 4:31:54 PM   
  LCoughdrop

 

Posts: 48
Score: 0
Joined: 8/23/2004
From:
Status: offline
I don't know what I am doing wrong, but nobody is responding! :) Please let me know if I am asking an improper question... Someone please just even write back to let me know someone cares!! ;)

EDIT::
It might make it a little easier if I clarify the issue...

Basically what I am trying to do is create a script that...

1) Opens an explorer window and goes to an address

2) Can locate a field in the web site and type text (i think it would be into a java applet)

3) Click a button (possibly in a java applet)

4) adjust the screen size / or / create a system tray icon / or any other indicator of whether the user has logged in. (status is indicated by a text field, again I Believe it is in a java applet)

Help with any of these steps would be greatly appreciated as I am not really familiar with how to do this in VBScript...

Thanks!!!
 
 
Post #: 1
 
 Re: Create single interface to login to multiple sites - 8/24/2004 11:38:49 PM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
Lcough

Unfortunately, I am not sure how to do what you are looking to do. Sorry.

(in reply to LCoughdrop)
 
 
Post #: 2
 
 Re: Create single interface to login to multiple sites - 8/30/2004 12:14:51 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
Would you want this script to run at boot up?

(in reply to LCoughdrop)
 
 
Post #: 3
 
 Re: Create single interface to login to multiple sites - 8/31/2004 7:31:39 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
There are a couple ways to do this, all depends on how your work/school network is configured and how you log on to the laptop. Basically, you can check for a network folder i.e.
This will check for the folder once ever 10 seconds for 1 min.
quote:
Count = 0
Do
If Fso.FolderExists("\\server\Share\Folder") then
DoSomething here
Count = 10
Else
Count = Count + 1
End If
Wscript.Sleep 10000 'Pause for 10 seconds
Loop until Count = 10
If Count = 10 then Wscript.quit


Or you can check for a network source via the IPaddress/computername. All depends on the route you want to go.

(in reply to LCoughdrop)
 
 
Post #: 4
 
 Re: Create single interface to login to multiple sites - 9/1/2004 2:00:53 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
quote:
To check for an IP or Computer name, how would I go about that?

Here is some code (see below) that I have used to ping a PC via Computername. You don't need to use the GetIP sub if your don't want to return the IP address.

There is a script encoder that will encrypt a script but it is not that safe. Another way is to look at something like AutoIT (www.hiddensoft.com) which allows you to create an EXE that would be a bit safer as you can password protect the exe.
Off to a meeting.
Mike

quote:
Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
Dim WshShell : Set WshShell = createobject("wscript.shell")
strComputer = "The-Computer-Name"
'Ping Computers
set png = WshShell.exec("ping -n 1 " & strComputer)
do until png.status = 1 : wscript.sleep 10 : loop
strPing = png.stdout.readall

'NOTE: The string being looked for in the Instr is case sensitive.
'Do not change the case of any character which appears on the
'same line as a Case InStr. AS this will result in a failure.
Select Case True
Case InStr(strPing, "Request timed out") > 1
strReply = "Request timed out"
strIpAddress = GetIP(strPing)
Case InStr(strPing, "could not find host") > 1
strReply = "Host not reachable"
strIpAddress = "N/A"
Case InStr(strPing, "Reply from") > 1
strReply = "Ping Succesful"
strIpAddress = GetIP(strPing)
End Select
msgbox strReply & vbcr & strIPAddress

Function GetIP(ByVal reply)
Dim P
P = Instr(reply,"[")
If P=0 Then Exit Function
reply = Mid(reply,P+1)
P = Instr(reply,"]")
If P=0 Then Exit Function
GetIP = Left(Reply, P-1)
End Function

(in reply to LCoughdrop)
 
 
Post #: 5
 
 Re: Create single interface to login to multiple sites - 9/19/2004 4:34:55 AM   
  LCoughdrop

 

Posts: 48
Score: 0
Joined: 8/23/2004
From:
Status: offline
OK, well I'm back at it trying to finish up this login script. Seems to be going well. I was just wondering if anyone had any insight into how to read text inside a java applet.

One of the login screens that I am logging into is a javaapplet. I have been able to input text through the sendkeys command. However, the status is displayed in a java applet. Basically whether the login was successful, etc...

Is there any way to do this? I am pretty sure the text can be highlighted by the user (not positive though).

Thanks,

-- LC

(in reply to LCoughdrop)
 
 
Post #: 6
 
 Re: Create single interface to login to multiple sites - 9/20/2004 12:00:47 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
I am not sure if this can be done with vbscript but you can check out AutoIT. They have a program to reveal what is in an active window which would allow you to see what can be read from that window. www.hiddensoft.com

Mike

(in reply to LCoughdrop)
 
 
Post #: 7
 
 Re: Create single interface to login to multiple sites - 9/20/2004 1:08:30 AM   
  LCoughdrop

 

Posts: 48
Score: 0
Joined: 8/23/2004
From:
Status: offline
Thanks Mike,

I'll give it a try... :)

-- LC

(in reply to LCoughdrop)
 
 
Post #: 8
 
 Re: Create single interface to login to multiple sites - 9/21/2004 12:28:15 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
quote:
My two roadblocks so far are

1. I can't seem to figure out a good way to determine (once the connection with the wireless network at school is established) that the script should initiate.

One way to possibly do this is to check your IP. Since from what you are saying, you connect to the wireless network, you should atleast have an IP address. Do an ipconfig /all and see what info might be useful (DNS suffix, DHCP/DNS/WINS/etc server, see script below.

quote:
2. I can't seem to figure out how to log into the firewall (WatchGuard) and determine the status. I have tried the sendkeys command, but I am not entirely comfortable with it especially because a password would be input and it could potentially be displayed on screen somewhere

Not really sure if there is a better way to do this, sendkeys might be the best. You can possibly use AutoIT for this part and use one of the wait functions. i.e. wait till the window is active before sending username, and verify that the window is active again before sending the password, this may help with not sending keys to the wrong window.

Hope this helps some.
Mike

quote:

      

(in reply to LCoughdrop)
 
 
Post #: 9
 
 Re: Create single interface to login to multiple sites - 9/21/2004 12:46:57 AM   
  LCoughdrop

 

Posts: 48
Score: 0
Joined: 8/23/2004
From:
Status: offline
That's pretty clever, I'll give it a try today! Thanks!!

-- LC

(in reply to LCoughdrop)
 
 
Post #: 10
 
 Re: Create single interface to login to multiple sites - 9/22/2004 11:04:42 AM   
  LCoughdrop

 

Posts: 48
Score: 0
Joined: 8/23/2004
From:
Status: offline
I'm trying to write the script so that an HTML page is opened when the connection is established. Right now I have created the interface and when the user clicks the button on the HTML page (or HTA), a window should open and then some text should be entered automatically etc... everytime i try this i get (object required 'wscript') ... is this a limitation of scripting?

(in reply to LCoughdrop)
 
 
Post #: 11
 
 Re: Create single interface to login to multiple sites - 9/23/2004 12:37:48 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
What does your header look like in your HTA page? Below is what I use in mine.

Dim WshShell : Set WSHShell = CreateObject("Wscript.Shell")
Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")

(in reply to LCoughdrop)
 
 
Post #: 12
 
 Re: Create single interface to login to multiple sites - 9/23/2004 3:34:16 AM   
  LCoughdrop

 

Posts: 48
Score: 0
Joined: 8/23/2004
From:
Status: offline
Even just this command by itself fails...but it works as a VBS.
How would I launch an explorer window in an HTA?
Set objIE = WScript.CreateObject("InternetExplorer.Application","objIE_")

Is this the best way?
This is what I want...

A script is on the computer running in the background to initiate an HTML page that I have designed when a particular connection is established.

Through the HTML page there are four sets of fields. each set has a username and password field. Each set also has a submit button. When the button is clicked, a script is initiated that opens a window and fills in info and logs the user in.

or, if all four sets are prefilled out, the user can be autologged in to all four sites upon establishment of the connection.

I am thinking the best way to set this up is to have a script that calls the HTA page. Each button on the HTA launches another script (or sub within the HTA) but are there limitations to what I can do within the HTA?? Is there another way to put an HTML like interface onto my script. There is no reason the interface would have to be anywhere except on the single target computer.

(in reply to LCoughdrop)
 
 
Post #: 13
 
 Re: Create single interface to login to multiple sites - 9/23/2004 4:32:34 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
From what you are saying, it seems like HTA would be the way to go. I have not tried to launch IE in a HTA page though, will need to give it a try.

Try this, notice no wscript before the createobject.
Set objIE = CreateObject("InternetExplorer.Applicatin","objIE_")

Will give this a try myself.
Mike

(in reply to LCoughdrop)
 
 
Post #: 14
 
 Re: Create single interface to login to multiple sites - 9/23/2004 4:45:28 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
This worked for me when launching a webpage from an HTA page.

quote:
<head>
<title>Something</title>
<HTA:APPLICATION ID="oHTA"
SCROLL="no"
APPLICATIONNAME="HTA Verification"
NAVIGABLE="yes">
</head>
<body bgcolor="#E1ECFC" text="#000000" style="font-family: Verdana; font-size: 8pt">
<script language="VBscript">
Sub Window_Onload
Set IE = CreateObject("InternetExplorer.Application")
ie.left=0
ie.top=0
ie.menubar=1
ie.toolbar=1
ie.navigate "http://www.google.com"
ie.visible=1
End sub
</script>
Something something something
</body>

(in reply to LCoughdrop)
 
 
Post #: 15
 
 Re: Create single interface to login to multiple sites - 9/24/2004 8:49:20 AM   
  LCoughdrop

 

Posts: 48
Score: 0
Joined: 8/23/2004
From:
Status: offline
Thanks :) Working on it right now... Question, what is your recommended script editor... using Notepad right now. It's fine, but is there anything good out there??

Also, having trouble accessing objects within the IE window...getting an error with the following code. Similar code works if the file is a VBS and WScript is used. Is there an alternative?

Set IE = CreateObject("InternetExplorer.Application")
ie.left=0
ie.top=0
ie.menubar=1
ie.toolbar=1
ie.navigate "www.theloginpage.com" 'actual address was changed
ie.visible=0
ie.forms(0).txtUsername.value ="username" 'usually the actual name
ie.forms(0).txtPassword.value = "password" 'the actual pw
ie.forms(0).btnLogin.Click()
ie.visible = 1

-- LC

(in reply to LCoughdrop)
 
 
Post #: 16
 
 Re: Create single interface to login to multiple sites - 9/24/2004 9:15:15 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
One of the best is Primalscript but it is also the most expensive. The one I use is Editplus www.editplus.com
, it is only around 30-40 or so. It does HTML/Vbscript/AutoIT, etc. I have demo'd Admin Script Editor: http://www.adminscripteditor.com and it looks promising, about the only thing holding me back is that I am not able to test the exe packager. To me this is the feature that would push me to buy it.

As to the forms issue, I can honestly say that I have never used it, and can't think of another way to do this. Will need to think on it.

(in reply to LCoughdrop)
 
 
Post #: 17
 
 Re: Create single interface to login to multiple sites - 9/24/2004 5:13:36 PM   
  LCoughdrop

 

Posts: 48
Score: 0
Joined: 8/23/2004
From:
Status: offline
Running across other limitations as well... cannot figure out a way to input to the javaapplet now because sendkeys does not seem to work in the HTA (because I cannot use WScript object) Any ideas?? this whole thing seems to be falling apart ;)

-- LC

(in reply to LCoughdrop)
 
 
Post #: 18
 
 Re: Create single interface to login to multiple sites - 9/25/2004 5:55:08 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
A couple things come to mind,
1) Create a seperate script that you use to send keys. or Create this script of the fly
2) create an AutoIT exe to send keys.

(in reply to LCoughdrop)
 
 
Post #: 19
 
 Re: Create single interface to login to multiple sites - 9/26/2004 11:48:51 PM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
quote:
Originally posted by LCoughdrop
Also, out of curiousity is there any way to change the width, height or screen position of the HTA


In your script section add this:
sub window_onload()
window.resizeto 500, 400
Window.MoveTo 450,450
end sub

quote:

-the "always_on_top" status?
-any way to minimize to systray?
-any way to launch the HTA from within a vbs...?



-This might be one of the settings in the header, but can't remember which.
-Not that I know of.
-Yes, WshShell.Run "Mshta.exe Filename.hta",1,true

Now that I think on it, I am using a Forms(0) thing in one of my HTA's, here is a quick example of it. This will open a window so you can browse for a file. Once OK is clicked it will pop-up a msgbox with the file name

quote:
<head>
<title>Something</title>
<HTA:APPLICATION ID="oHTA"
SCROLL="no"
APPLICATIONNAME="HTA Verification"
NAVIGABLE="yes">
</head>
<body bgcolor="#E1ECFC" text="#000000" style="font-family: Verdana; font-size: 8pt">
<script language="VBscript">
sub but_onclick()
status = document.forms(0).elements(0).value
msgbox status
end sub
sub butc_onclick()
status = "cancel"
end sub
</script>
<form>
<INPUT TYPE="file"></input>
<input type="button" id="but" value="OK"></input>
<BR><BR>
<input type="button" id="butc" value="CANCEL"></input>
<BR><BR> Browse for file, then click OK.
</form>
</body>

(in reply to LCoughdrop)
 
 
Post #: 20
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Create single interface to login to multiple sites Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts