Martinlest Posted December 24, 2013 Report Posted December 24, 2013 EDIT: Ooops, am I posting this in the wrong forum? Sorry!! Hi. For reasons I won't bore you with, I am trying to run the (very neat!!) makerunways programme as part of a batch script (part of automating a database process). It is activated by this vbs script: ------------------------------------ intAnswer = _ Msgbox(" Do you want to run MakeRunways?", _ vbYesNo, " ")If intAnswer = vbYes ThenWScript.Sleep 2000Dim objShellSet objShell = WScript.CreateObject( "WScript.Shell" )objShell.Run("""D:\FS9\MakeRwys.exe""")Set objShell = NothingElse 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 setup! If I run it from the file itself the programme finds 30000, or whatever. Why would the programme, once successfully started, show these differences, depending on whether I start it directly, or via a script? Thanks, Martin
Pete Dowson Posted December 24, 2013 Report Posted December 24, 2013 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 setup! If I run it from the file itself the programme finds 30000, or whatever. Why would the programme, once successfully started, show these differences, depending on whether I start it directly, or via a script? I don't know VBS, but the first thing to do is view the file called Runways.txt which is produced. This is a complete log of what it did. Most importantly it will tell you which "scenery.cfg" file it used to locate the sceneries. It determines this by firstly identifying the version of FSn/ESP/P3D from the relevant EXE in the current folder, so determining the correct path to the Scenery.cfg folder. Pete
Martinlest Posted December 24, 2013 Author Report Posted December 24, 2013 Salvaging the file from the recycle bin, it simply says this (curiouser and curiouser!): Make Runways File: Version 4.60 by Pete DowsonReading FSX updated SCENERY.CFG ... CFG file being used is: "D:\FS9\scenery.cfg" FSX??? Nothing has mixed these files up before. They are on separate partitions and the vbs file doesn't mention FSX... You said "It determines this by firstly identifying the version of FSn/ESP/P3D from the relevant EXE in the current folder, so determining the correct path to the Scenery.cfg folder". So what would that imply? Which is the 'current folder'? Where Makerwys.exe is (that's my main FS9 folder)? Hope you have a good Christmas Pete. Maybe get back to this after the 'festive saeson'! Martin
Pete Dowson Posted December 25, 2013 Report Posted December 25, 2013 Salvaging the file from the recycle bin, it simply says this (curiouser and curiouser!): Why the recycle bin? Make Runways File: Version 4.60 by Pete Dowson 4.60 is out of date and unsupported. Please use the current version, 4.674. Reading FSX updated SCENERY.CFG ... CFG file being used is: "D:\FS9\scenery.cfg" FSX??? Nothing has mixed these files up before. They are on separate partitions and the vbs file doesn't mention FSX... You said "It determines this by firstly identifying the version of FSn/ESP/P3D from the relevant EXE in the current folder, so determining the correct path to the Scenery.cfg folder". So what would that imply? Which is the 'current folder'? Where Makerwys.exe is (that's my main FS9 folder)? The "current folder" probably needs setting by your VBS file, unless you are running it from that folder (not sure about that though). If you make a shortcut to a program you will see, in the Properties of that short cut, both the Link to the program itself AND a path, labelled "Start in". Normally you want the "start in" path to be the same as where the program is, but not always. MakeRunways needs to "start in" the main FS folder so it can identify the version. In DOS terms the "start in" folder is the "current folder" and is set by a command like CD. I don't know how it is done in VBS. As for thinking it is FSX, all MakeRunways is doing is checking for the presence, in the current folder, of these EXE files, in turn: Prepar3D.exe ESP.exe FSX.exe If none of those are present it assumes FS9. (If Prepar3D.exe is present it reads its version number to see if it is 1.x or 2.x). It seems yu must have some such exe in whatever is the 'current path'? This then determines where it looks for the SCENERY.CFG file, which for FSX should actually be in the ProgramData\Microsoft\FSX folder. Pete
Martinlest Posted December 27, 2013 Author Report Posted December 27, 2013 Thanks for the reply. (".. from the Recycle Bin", because I had deleted the files before running makerunways.exe again). The vbs file works by accessing the makerwys.exe file itself, not a shortcut. Of course the exe file is in the main FS9 folder, in which there is no FSX data! Very odd. I might ask on a scripting forum.. it's no big deal that it doesn't work, I can run the exe directly rather than through the batch script (which would be 'neater', but no matter): it's more the fact that it does this strange thing, and why, that intrigues me. I have updated the exe file, Thanks again, Martin
Pete Dowson Posted December 27, 2013 Report Posted December 27, 2013 The vbs file works by accessing the makerwys.exe file itself, not a shortcut. Of course. I only suggested you looked at a shortcut (ANY shortcut) to see what I meant about "current folder", as I explained. Of course the exe file is in the main FS9 folder, in which there is no FSX data! The folder in which the EXE is in is not really so relevant, it is the CURRENT FOLDER which is relevant. i.e. the one the EXE gets files from if it specifies just the filename, no path. it's more the fact that it does this strange thing, and why, that intrigues me. I'm pretty sure that if it works okay when executed with the FS9 folder as the current folder (which will be the case automatically if you double click on the EXE in the FS9 folder, or double click a shortcut to it made by using the right-click "create shortcut" option in Explorer), then it will work in exactly the same way if you simply ensure that the current folder is set to the FS9 folder. If you really do not know how to do that in VBS, or if it is not possible, try placing your VBS file in the FS9 folder and executing it there. Pete
Martinlest Posted December 27, 2013 Author Report Posted December 27, 2013 ... try placing your VBS file in the FS9 folder and executing it there Good idea - that works! :razz:
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now