Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Launch IIS Express Web Site from Context menu into a BROWSER via the REGISTRY or BAT

Posted on 2013-01-08
6
Medium Priority
?
1,149 Views
Last Modified: 2013-01-26
I am trying to launch an ASP Web Application on a standalone machine into a Web Browser as 'localhost' from the Context Menu in Windows Explorer using IIS Express. I have a registry edit that does everything but open the application in the browser.

QUESTION ONE: What do I need to add to the code below to open and display the required ASP Application (attached) in a web browser using this method.  

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\IISExpress]
@="Edit Database in Browser"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\IISExpress\command]
@="cmd /c start /D\"C:\\Program Files (x86)\\IIS Express\\\" iisexpress.exe /port:1029 /clr:v2.0 /path:\"d:\jcsv\default.asp""

Open in new window


IISExpress has command line options to load pages using the 'path' switch.  Even if the server is running it still will not display this site.  A successful load uses the commands displayed in the attached CMD image.

I have also explored the use of a separate bat file to try and launch everything from the desktop as an alternate to the context menu option. This may be a better solution to run the extra commands required.

@echo off

set /A port = 1029

rem start the server and the browser
rem start "IIS Express" "%ProgramFiles(x86)%\IIS Express\iisexpress.exe" /path:\"d:\jcsv\default.asp
start "IIS Express" "http://localhost:1029/tblDatalist.asp"

Open in new window



The SECOND QUESTION is How do I launch these separate processes shown in the attached image from either solution?. It is OK if the registry context menu calls the batch file to run the required commands.?

I have also attached the sample ASP website and database in a file called jcsv.zip.txt  Just remove the .TXT to use it as a zip. The sample registry and IISExpress config files in the application subfolders are are default or unaltered.  The code above is the working code.

The SUCCESSFUL answer will enable me to display the attached website from the context menu or from a shortcut that executes the bat file to display the attached site in a browser.
jcsv.rar.txt
IISExpressLoadSample.jpg
0
Comment
Question by:XGIS
[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
  • 3
  • 3
6 Comments
 
LVL 83

Accepted Solution

by:
David Johnson, CD, MVP earned 1500 total points
ID: 38757508
---- batch file ---
@echo off
set /A port = 10290
set /A mypath = d:\downloads\jcsv
rem start the server and the browser
start "IIS Express" "%ProgramFiles(x86)%\IIS Express\iisexpress.exe" /path:%mypath%/port:%port%
start "Internet Explorer" "%ProgramFiles(x86)%\Internet Explorer\iexplore.exe"  http://localhost:%port%/tblDatalist.asp

Open in new window

0
 
LVL 7

Author Comment

by:XGIS
ID: 38757668
Hello ve3ofa,

Pls note your code works, but I cannot get it to 'see' the actual website as i get "Internet Explorer cannot display the webpage" The error states there is no connection to the device.

Is there something else that needs to be initiated before this particular asp application to display?

The main difference I have noticed is that it assigns a website name.  

Please advise. Thankyou
0
 
LVL 83

Expert Comment

by:David Johnson, CD, MVP
ID: 38761749
It works fine here http://www.screencast.com/t/FoN6aEgOa3

is iis express actually started?  there should be a console window open that shows the requests etc... I could not use port 1029 as it was already in use on my machine.
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 7

Author Comment

by:XGIS
ID: 38765189
Hello  ve3ofa,
Yes yours works fine. I have disabled my firewall, but no change.  My CMD window disappears on load. I will try some variations of the script.
0
 
LVL 83

Expert Comment

by:David Johnson, CD, MVP
ID: 38765285
that means that iis express could not start.. change the port as the port is probably in use. mine was in use by lsass, firewall settings are immaterial as it is all local
0
 
LVL 7

Author Closing Comment

by:XGIS
ID: 38822801
Thankyou
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
A quick guide on how to use Group Policy to create a custom power plan and set it active on Windows 7.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

688 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