Question

CGI Running Wrong Exe (ASP, VB6 & IIS 6)

Asked by: robert_f

Hi All
I've got two VB6 exes running as CGI on IIS6 W2k3 server, triggered from an asp page. Now when I run them under IIS5 (W2k) theres no problem, however we are transferring to a new box and therefore I need to get them working and its driving me mad!

Basically there are two exe's DataCheck1.exe and DataCheck2.exe. The user clicks a button on an asp page which dictates which one to run. Onclick for the button flags a hidden field and submits the page. Based on whats in the hidden field when the page reloads theres an "if statement" at the top of the page which does a response.redirect to the appropriate exe.

The problem is that regardless of what I seem to do the page only *ever* runs Datacheck2.exe. The annoying thing is that if I view the properties of the page generated it will say http://localhost/datacheck1.exe?id=27 but I know for a fact that its actually ran DataCheck2.exe!

To prove this I removed DataCheck2.exe and then told the page to run DataCheck1; the page errors saying it cant find the file to run. Put it back and it runs through but using DataCheck2.exe.

Hope someone can help before I end up in a padded cell!!

Cheers

Rob

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-03-23 at 15:44:47ID24257467
Topics

CGI Scripting

,

Active Server Pages (ASP)

Participating Experts
2
Points
500
Comments
19

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. CGI And HTML
    I have four options on a HTML page i.e. Option 1. Option 2. Option 3. Option 4. I would like the user to choose anyone of the above options and, the chosen option would execute a cgi script. Note each option excutes a different cgi script. Can somebody provide me with the...
  2. CGI
    What deferent cgi .pl and .exe how can we create a .exe cgi? thanks
  3. cgi
    How to connect database using cgi programs?
  4. what is CGI?
    what is CGI? can you explain in details to me?
  5. what is cgi
    I want to know what is cgi and how can i use it specially in visual basic

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: ken_thaiPosted on 2009-03-23 at 17:50:18ID: 23963791

Have you check the place where you dictate which exe to call? And the batch file or wherever you tell the system to run which exe.

How did you call them from the ASP file in the first place?

 

by: robert_fPosted on 2009-03-23 at 18:08:51ID: 23963878

Hi Ken

I just use response.redirect to run from ASP page e.g. response.redirect "../scripts/datacheck1.exe?id=27". Double & triple checked that I'm calling the right one. Even commented out the other just to make quadruply sure i wasnt inadvertently running the wrong one.

Annoying thing with this is that it runs fine on the old box ... didnt know if it was some quirk of 2003 ./ IIS 6?

Cheers

Rob

 

by: ken_thaiPosted on 2009-03-23 at 20:26:01ID: 23964470

What about the IIS settings of the site? If you still have the old box, verify that you have duplicate the setting as it is in the new box.

 

by: robert_fPosted on 2009-03-24 at 02:43:33ID: 23965999

Hi Ken

Done all that, everything is set the same on both.

Cheers

Rob

 

by: Adam314Posted on 2009-03-24 at 11:35:25ID: 23971616

What about if you type in the URL box of your browser:  www.somesite.com/scripts/datacheck1.exe?id=27

What is in your access log, datacheck1 or datacheck2?

 

by: ken_thaiPosted on 2009-03-24 at 15:49:12ID: 23974242

That is very strange. Do you have some kind of log file? Write to a text file before you do anything and then run your program. Hopefully that can shred some line as what going on with the program.

If that doesn't help, try get ProcessMonitor. Google and download it. It a software that can track all the event in the file system (as well as many other stuff). Powerful but does eat up resource. So it is not a good idea to run it for a long time. Run it just before you evoke your program. Then once your program is finish, export the report from ProcessMonitor and terminate it

Note that for best reading purposes, turn off all the other events that you dont' want to view before export the report.

 

by: robert_fPosted on 2009-03-24 at 15:49:52ID: 23974247

Hi Adam

It shows the one I've asked it to run but I know its running the other because if I rename the other one and try it errors
e.g.  run "www.somesite.com/scripts/datacheck1.exe?id=27" but with datacheck2 renamed to testdatacheck2.exe and i get the standard "cant find the page". Rename datacheck2 and it runs even though the log shows datacheck1 as having ran.

Cheers

Rob

 

by: robert_fPosted on 2009-03-24 at 15:52:01ID: 23974266

Thanks Ken, I'll give that a whirl and come back to you. Appreciate the assistance.

Cheers

Rob

 

by: Adam314Posted on 2009-03-24 at 16:02:57ID: 23974350

Can you tell which program ran, either from it's output, or something it does?  Or is the error when datacheck2.exe is missing the only reason you believe it is running that?  Does it otherwise appear that datacheck1.exe is being executed?


copy datacheck1.exe to datacheck1_test.exe
copy datacheck2.exe to datacheck2_test.exe
delete both datacheck1.exe and datacheck2.exe
Don't do a rename, do a copy and then delete.
Try accessing both through your web server.  What are the log files showing?  What appears to be running?

 

by: robert_fPosted on 2009-03-24 at 16:04:50ID: 23974362

Just as an update; I've reran again to doubel check and the IIS logs are definately showing the one i "think" I'm running and not the one thats actually running.

Also I've logged a call with our new hosting guys so I'll see if any of them can shed any light. Many thanks for the suggestions to date.

Cheers

Rob

 

by: robert_fPosted on 2009-03-24 at 16:19:44ID: 23974504

Hi Adam

No i can tell which ones running as i've popped some text in the header that the program generates basically just says "data1" or "data2" on the outputted page so I can see. The file rename was more of a "double" check than anything to try and confirm i wasnt going mad! :-)

I've also tried the copy / rename / delete option previously. The log file always shows as running the "renamed" file (i.e. datacheck1_test.exe) but still runs datacheck2. However if I then rename datacheck2 i get the "cant find page" error regardless of what i've renamed datacheck1 to.

Cheers

Rob

 

by: Adam314Posted on 2009-03-24 at 16:22:21ID: 23974530

So, for any executable request in this directory, it always runs datacheck2.exe instead of what's requested?  If you have datacheck3.exe (a copy of datacheck1.exe), it'll still run datacheck2.exe?

 

by: robert_fPosted on 2009-03-24 at 16:30:40ID: 23974594

Yep, if I copy datacheck1 to datacheck3 and then change the code to run datacheck3 it still executed datacheck2. I've even moved them out to seperate folders e.g inetpub\scripts1 and inetpub\scripts2 and still runs datacheck2.

Cheers

Rob

 

by: ken_thaiPosted on 2009-03-24 at 16:56:31ID: 23974765

Ah i think the problem is more fundamental than you think. So your page is host in a remote server? That mean you don't have much power over it. Please check with them they had not hard wire your cgi to a particular exe and only run it regardless of what program you ask it to run.

 

by: robert_fPosted on 2009-03-24 at 17:11:39ID: 23974830

Hi ken
It's remote but it's our own dedicated box. Having said that I have logged a call asking them to look into it. I'll keep you informed.

Cheers

Rob

 

by: Adam314Posted on 2009-03-24 at 21:27:20ID: 23976063

I said>>So, for any executable request in this directory, it always runs datacheck2.exe..
You said>>Yep...I've even moved them out to seperate folders ... and still runs datacheck2.

So, for any executable request, no matter what the path to it is, it always runs datacheck2.exe?

Can you create an executable that just displays all of the environment variables (after a proper http header), and call it datacheck2.exe.  Then call it through your web-server, then post here the values of all those vars.

 

by: robert_fPosted on 2009-03-25 at 02:59:34ID: 23977464

Hi Adam
Yes, that certainly appears to be the case, cant say if it does it for any exe as theres only these two that I run. I'll try and get something knocked together this afternoon along the lines of your suggestion. Thanks for all your help to date.
Cheers
Rob

 

by: robert_fPosted on 2009-03-31 at 01:01:58ID: 24026621

Hi All

Just to let you know, I've not forgotten about this ... been away for a few days and therefore havent had chance to try anythiing further. I'll keep you updated.

Cheers

Rob

 

by: robert_fPosted on 2009-04-07 at 02:01:20ID: 31567398

Hi Gents
Well, I ended up resintalling IIS and that seemed to clear up the issue and everythings working again as it should. Many thanks for your help and suggestions though, as ever I appreciate everyones help on EE.

Cheers

Rob

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...