Solved

.VBS VBScript to Launch URL & NOT add to history

Posted on 2011-03-11
17
1,500 Views
Last Modified: 2012-05-11
I need to use VBScript (.vbs file) to open a URL, but not add the URL to the browser history. This is NOT for MS Access VBA -- but...
...In VBA in MS Access, if I were using it, I would use:
Application.FollowHyperlink "http://www.google.com", , , AddHistory:=False
...but again I need to use VBS.

I don't see a property in the MSDN documentation (if it's even the right documentation) at http://msdn.microsoft.com/en-us/library/aa752084(v=vs.85).aspx

So how does Application.FollowHyperlink do it, and how can I do something similar in VBA? (I just don't want this particular link to get added to the history, I don't want or need to delete all my history.)
Option Explicit 
Dim IE 
Set IE = wscript.createobject("internetexplorer.application","IE_") 
With IE
	.visible = False
	.AddHistory = False
	.navigate ("http://www.google.com/") 'May contain website login info, and thus I don't want this to be added to this history. How do I implement that?
	while (.busy)    'wait until the site gets loaded 
		wsh.sleep 400
	wend
	while (.ReadyState = 4) 'ReadyState_Complete
		wsh.sleep 400
	wend
	'IE.visible = True 'Commented to continue hiding
	.quit
End With 'IE
Set IE = Nothing

Open in new window

0
Comment
Question by:travisjbennett
  • 7
  • 6
  • 4
17 Comments
 
LVL 30

Expert Comment

by:SiddharthRout
ID: 35113827
0
 
LVL 45

Expert Comment

by:aikimark
ID: 35114297
@Sid

This is a VBScript environment.
0
 
LVL 1

Author Comment

by:travisjbennett
ID: 35115435
Sid, I'm about to get to work. I'm a little confused though by your last post: (what) is a VBScript environment?

The code of your first post?
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 1

Author Comment

by:travisjbennett
ID: 35115791
I tried the code below after clearing my history. Microsoft.com still got added to my history list.

At the bottom of your second link, in community content, it says that this flag won't keep a site from getting added to the main history list.
Option Explicit 
Const navNoHistory = &h0002
Dim IE 
Set IE = wscript.createobject("internetexplorer.application","IE_") 
With IE
	.visible = False
	.navigate "http://www.microsoft.com/", CLng(navNoHistory)
	while (.busy)    'wait until the site gets loaded 
		wsh.sleep 400
	wend
	while (.ReadyState = 4) 'ReadyState_Complete
		wsh.sleep 400
	wend
	'IE.visible = True 'Commented to continue hiding
	.quit
End With 'IE
Set IE = Nothing

Open in new window

0
 
LVL 30

Expert Comment

by:SiddharthRout
ID: 35115812
@aikimark: Yes I know it is vbscript :)

@travisjbennett: You have defined the constant incorrectly. I just tried this and it works.

Option Explicit
Const navNoHistory = &H2

Dim IE
Set IE = wscript.CreateObject("internetexplorer.application", "IE_")

With IE
    .Visible = True
    .navigate "http://www.rediff.com/", navNoHistory
    While (.busy)    'wait until the site gets loaded
        wsh.sleep 400
    Wend
End With

Open in new window


Sid
0
 
LVL 30

Expert Comment

by:SiddharthRout
ID: 35115824
travis: Seems I spoke to soon. I just tried it with a different URL and it got added. Lemme check.

Sid
0
 
LVL 30

Expert Comment

by:SiddharthRout
ID: 35115841
Yes you are right. I read the community comment in this link as well.

http://msdn.microsoft.com/en-us/library/aa768360%28VS.85%29.aspx

Seems like that flag doesn't work. Dunno why MS put it then.

Sid
0
 
LVL 1

Author Comment

by:travisjbennett
ID: 35115852
I think that flag has to do with the back & forward buttons...
if that page (or maybe the preceeding page that the browser was on before the command?) is accessible with back and forward.

Any other ideas, or maybe a seperate script or something that could do it? I do not want to use MS Access here.
0
 
LVL 45

Expert Comment

by:aikimark
ID: 35116096
If the browser is IE8, the documentation states that you can use the -private command line switch.

http://msdn.microsoft.com/en-us/library/ee330728(v=vs.85).aspx

=======
You might choose to clear the history at the end of your process.
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1

Open in new window


http://www.howtogeek.com/howto/windows/clear-ie7-browsing-history-from-the-command-line/

=======
You might consider using a different browser (not IE)
0
 
LVL 1

Author Comment

by:travisjbennett
ID: 35116098
I mentioned my browser, but only in the question tags. I am limited to IE7.
0
 
LVL 45

Expert Comment

by:aikimark
ID: 35116118
Can you tolerate any browser history entries?  If so, you might be able to display the content of the actual web site from a neutral web site (within a frame).

Is the site always going to be the same site?

======
What problems are you trying to circumvent by preventing a browser history entry?  Knowing the context of the problem might be helpful to the participating experts.
0
 
LVL 1

Author Comment

by:travisjbennett
ID: 35116157
I need to pass a plaintext password in the URL. The password is very sensitive.

I can't put it in a frame of a page hosted anywhere other than localhost. I cannot tolerate any browser history entries that would include the URL with the password in it, encrypted or not.
0
 
LVL 45

Accepted Solution

by:
aikimark earned 500 total points
ID: 35116321
Since the password is sensitive, you shouldn't send it in an unencrypted form unless you are using SSL.  In your case, encrypt the password with a salt and then convert it into Base64 format.  Make sure the salt changes with each use.

WARNING:
Since this is a VBScript, please be aware that your script will likely include a plain text copy of the password.
0
 
LVL 1

Author Comment

by:travisjbennett
ID: 35140988
Aikimark,

You're right -- I had forgotten about packet sniffing. The server doesn't currently offer SSL, but I'll be waiting for it to do so.

When it does, do the URLs of SSL pages get stored in the IE7 history?
0
 
LVL 45

Expert Comment

by:aikimark
ID: 35142135
@travisjbennett

I think we ought to start with the requirements and see if there are ways to achieve what you want.  For instance, there are applications, such as Putty, that provide secure TCP/IP communication.
0
 
LVL 1

Author Comment

by:travisjbennett
ID: 35142202
There's actually not a way to do this, and I can't really go into the details for security reasons. For example, I've already had to change my password after sending it out over the network as plaintext.

I can award you the points for the right answer though. Thanks for the slap on the back of the head (I deserved it)!
0
 
LVL 45

Expert Comment

by:aikimark
ID: 35142253
@travisjbennett

While I appreciate the points, I disagree with your conclusion that there's "not a way to do this".  Good luck with this problem.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question