?
Solved

Creating Batch File

Posted on 2003-03-30
7
Medium Priority
?
181 Views
Last Modified: 2010-04-13
Using: Win2000 IE6.  Want to create a batch file that open IE and then CTRL + O - anyone can help? Thanks.
0
Comment
Question by:PCDJ
[X]
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
7 Comments
 
LVL 10

Expert Comment

by:makerp
ID: 8237213
use Windows scripting host. create a file with a .vbs extension and copy this code into it.

Set WshShell = Wscript.CreateObject("Wscript.Shell")
WshShell.Run "C:\Program Files\Internet Explorer\IEXPLORE.EXE"
WshShell.SendKeys("^o")
0
 
LVL 2

Expert Comment

by:bonzai
ID: 8237664
Hi

I had the same idea, but I don't like the
"sendkeys" (depends to much on System's speed. What happens if your window is not active?)

what do you want to do exactly? Open Files or navigate to URL's?

assuming you want your user to input an URL and then browse-to:¨

'-------------sample script-------------
Set oIE = CreateObject("internetexplorer.application")

pageToGo = inputbox("Enter URL","vbscript sample")

oIe.visible = true
oIe.navigate pageToGo
'---------------------------------------

greets
bonzai
0
 

Author Comment

by:PCDJ
ID: 8239270
I created a new text doc, pasted makerp's code, changed to .vbs - did not work.  Used Bonzai's code - sweet !  Thank You Both!
-Ron
0
10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

 

Author Comment

by:PCDJ
ID: 8246827
OK, that code Bonzai supplied, who can add to it?

If I run that, I'm prompted for a URL.  If I click the X or Cancel, the web browser opens and says Cannot Find Server.

What can I add to the code so that doesn't happen, or browser closes, or goes to a default URL specified in the code.  Prefer the browser just closed though.

Thank You
0
 
LVL 2

Accepted Solution

by:
bonzai earned 200 total points
ID: 8251957
Hi

try this...

'---------------------------------------
main
sub main()
     Set oIE = CreateObject("internetexplorer.application")
     pageToGo = inputbox("Enter URL","vbscript sample","www.google.com")
     select case pagetogo
          case ""
               exit sub
          case Else
               oIe.visible = true
               oIe.navigate pageToGo
     end select
end sub

'---------------------------------------
0
 

Author Comment

by:PCDJ
ID: 8253625
SWEET!!!!

Thank U- a thousand times!

I removed the www.google.com and it worked just as fine.
Nice how the pre-determined url is 'selected', ready for typing!

-Ron
0
 
LVL 5

Expert Comment

by:cempasha
ID: 8595541
This question is still open and getting old. If any of the comment(s) above helped you please accept it as an answer or split the points who ever helped you in this question. Your attention in finalising this question is very much appreciated. Thanks in advance,

****** PLEASE DO NOT ACCEPT THIS AS AN ANSWER ********

- If you would like to close this question and have your points refunded, please post a question in community support area on http://www.experts-exchange.com/Community_Support/ giving the address of this question. Thank you      

Pasha

Cleanup Volunteer


0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
The Summer 2017 Scholarship Winners have been announced!
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

762 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