Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

.VBS VBScript to Launch URL & NOT add to history

Posted on 2011-03-11
17
1,497 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
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.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

829 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