Jump to content
Sign in to follow this  
martinlest2

Any vbs/programming gurus here?

Recommended Posts

Hi. For reasons I won't bore you with, I am trying to run Pete Dowson's makerunways programme as part of a batch script programme. It is activated by this vbs script:

 

   intAnswer = _

    Msgbox("           Do you want to run MakeRunways?", _

        vbYesNo, " ")

 

If intAnswer = vbYes Then

 

WScript.Sleep 2000

Dim objShell

Set objShell = WScript.CreateObject( "WScript.Shell" )

objShell.Run("""D:\FS9\MakeRwys.exe""")

Set objShell = Nothing

 

Else    

 

End If

 

This starts the programme up just fine, but for some strange reason, it stops (not hangs - says it is finished) after locating only 46 runways in my entire FS9 setup! If I run it from the file itself the programme finds 30000, or whatever.

 

Why would the programme, once started, show these differences, depending on whether I start it directly, or via a script?

 

Thanks,

 

Martin

Share this post


Link to post
Share on other sites

I'm not sure why you have included either the sleep command or the double set of quotes on the run command. Both should be harmless, but maybe they are messing up the script compiler. If there were embedded blanks in the path, then you would need three quotes on either side of the string. With no embedded blanks, one quote on either end works.

 

The only other thing that I can think of is that by scripting, somehow, you are "starting off" in the wrong folder and this is causing trouble.

Share this post


Link to post
Share on other sites

I can try changing the quotes, but this format works in every other vbs script I use. The sleep command is not essential but makes the whole batch file, of which this vbs script is part, more 'user friendly'.

 

What is odd to me is that the programme starts up, as I imagined, but stops says it is done after finding just 46 airports. No txt, csv or xml files are created either, so something is very wrong.

Share this post


Link to post
Share on other sites

As you say, the script is for some reason starting off in the 'wrong' folder: placing the vbs file in the FS9 main folder (where the makerwys.exe file is) solves the problem.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...