DakotaPilot Posted July 18, 2021 Report Posted July 18, 2021 -I've used the Programs section of the FSUIPC ini file to run some programs and it works well. I am now trying to run another program but keep ending up with an error 237. the entries in the Program section are. I'm on FSUIPC 6. Run2=READY,CLOSE,C:\Users\NAME\AppData\Local\FS-Keypad\FS-Keypad.exe C:\Users\NAME\AppData\Local\FS-Keypad\Keypads\303df744-c367-4681-a409-4ac2f187b39e.json Run3=READY,CLOSE,C:\Users\NAME\AppData\Local\FS-Keypad\FS-Keypad.exe C:\Users\NAME\AppData\Local\FS-Keypad\Keypads\d221813d-fb88-4233-a6c6-c7491de17616.json and the fsuipc.log has this in it. 31437 FSUIPC couldn't run: "C:\Users\NAME\AppData\Local\FS-Keypad\FS-Keypad.exe C:\Users\NAME\AppData\Local\FS-Keypad\Keypads\303df744-c367-4681-a409-4ac2f187b39e.json" [Error=267] 31437 FSUIPC couldn't run: "C:\Users\NAME\AppData\Local\FS-Keypad\FS-Keypad.exe C:\NAME\Brett\AppData\Local\FS-Keypad\Keypads\d221813d-fb88-4233-a6c6-c7491de17616.json" [Error=267] If I run the command (minus the Runx=READY,CLOSE,) in a command window it works perfectly and brings up the window. I've tried to locate the error codes in the FSUIPC documentation but didn't find them. I must be doing something wrong but just can't find it. Based on the documentation and other posts dealing with the Programs section this should work.
aua668 Posted July 18, 2021 Report Posted July 18, 2021 Hi, Have you already tried to run it with quotes arround the command? Run2=READY,CLOSE,"C:\Users\NAME\AppData\Local\FS-Keypad\FS-Keypad.exe C:\Users\NAME\AppData\Local\FS-Keypad\Keypads\303df744-c367-4681-a409-4ac2f187b39e.json" Error 267 = directory name invalid (I assume) Rgds Reinhard
Pete Dowson Posted July 18, 2021 Report Posted July 18, 2021 Yes, it will be to do with needed quotes. For Windows error numbers, like 267, refer to: https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499- where you'll see, as Reinhard said: ERROR_DIRECTORY 267 (0x10B) The directory name is invalid.
DakotaPilot Posted July 18, 2021 Author Report Posted July 18, 2021 (edited) Ahh. Quotes on the entire string as in aua668 reply. I had quotes around each section - the exe path and the parameter - and just around the parameter but not around the whole thing. To clarify it for me. the manual (advanced) shows quotes around a path and around the parameter - each has it's own set of quotes but from what I see here you have to quote the exe and it's path along with any parameters - all in one set of quotes? Thanks. I'll try it shortly. So those are Windows return codes then, not FSUIPC. No wonder they weren't in the FSUIPC manual <G>! Edited July 18, 2021 by DakotaPilot
John Dowson Posted July 18, 2021 Report Posted July 18, 2021 8 minutes ago, DakotaPilot said: To clarify it for me. the manual (advanced) shows quotes around a path and around the parameter - each has it's own set of quotes but from what I see here you have to quote the exe and it's path along with any parameters - all in one set of quotes? But you have no parameters - at least not in what you posted, Quotes are only needed if the path contains spaces or if command line parameters are needed, as specified in the Advanced User manual, although it never does any harm to include them anyway. As (I presume) you replaced your actual name with the string NAME, we can't tell what the actual path is, but if it has spaces, it needs to be in quotes. As a test, you can also try running your run command from a terminal window, to see if it actually works outside of FSUIPC.
DakotaPilot Posted July 18, 2021 Author Report Posted July 18, 2021 I was assuming the second portion containing the JSON file was a parameter to the first part with the exe hence my confusion. There were no spaces in the path but I include them out of habit working with various systems that sometimes get snarky when handling spaces.
John Dowson Posted July 18, 2021 Report Posted July 18, 2021 Just now, DakotaPilot said: I was assuming the second portion containing the JSON file was a parameter to the first part with the exe hence my confusion. Ah, sorry - missed that! Then you should do as the manual suggests, quotes around the program start path and quotes around the parameter. You have no quotes, e.g. 13 hours ago, DakotaPilot said: Run2=READY,CLOSE,"C:\Users\NAME\AppData\Local\FS-Keypad\FS-Keypad.exe" "C:\Users\NAME\AppData\Local\FS-Keypad\Keypads\303df744-c367-4681-a409-4ac2f187b39e.json" If that doesn't work, you can try quotes around the whole line, but try that, as documented, first...
DakotaPilot Posted July 18, 2021 Author Report Posted July 18, 2021 I've got it set up for quotes around it all so I'll try that first. If that fails I'll go back and no quotes on the part with the exe but around the parameter part. Thanks.
DakotaPilot Posted July 18, 2021 Author Report Posted July 18, 2021 Okay. It appears that the exe doesn't look at the path but has to be in the same directory as the file. The desktop shortcut has not only the full path for the parameter but it seems to ignore the path part of the parameter and only look for the filename. Since the desktop shortcut has a working directory defined it moves to it, then looks for the file. At least that's what I think is happening. Anyway, I'll create a script to move to that directory and then execute those commands. Thanks for the help.
John Dowson Posted July 18, 2021 Report Posted July 18, 2021 24 minutes ago, DakotaPilot said: It appears that the exe doesn't look at the path but has to be in the same directory as the file. The desktop shortcut has not only the full path for the parameter but it seems to ignore the path part of the parameter and only look for the filename. Hmm/ Sounds a bit strange... Especially as the command works when you run it in a command window, which would suggest that the program is picking up the correct path. I think it may depend on which shell is being used to run/interpret the command. Did you try both with double quotes around the program location and the argument separately? And also around the whole command line command? And even if the command line argument is incorrect, doesn't the program start anyway and give some sort of error that the file can't be found? Or is the program closing and returning error code 267?
DakotaPilot Posted July 18, 2021 Author Report Posted July 18, 2021 I tried quoting it all. No luck there. I've had quotes on both the program and argument separately, and with none on the program but on the argument. Same result. The 267 error shows up in the FSUIPC log file. The program log files do not show anything but if it never started then that makes sense. The program never starts at all, no window that comes up and disappears, nothing.
DakotaPilot Posted July 18, 2021 Author Report Posted July 18, 2021 I found the issue. I wrote a Powershell script to start the exe and run one of the JSON files. Despite the fact that the full path to the JSON file is include it is ignored by the program. If I have the Powershell script cd to the apps home directory and then run the program with it's argument all is well. If I comment out the CD it whines. I'll let the author know as he may be making the assumption it always runs from a shortcut he creates which has the working directory so in effect it's cd'ing to the proper place and runs.
DakotaPilot Posted July 18, 2021 Author Report Posted July 18, 2021 You are welcome. FSUIPC is fantastic and I've made good use of it!
DakotaPilot Posted July 20, 2021 Author Report Posted July 20, 2021 I did some more testing and contacted the author. The program is supposed to run and if the json file has a full path it uses it. I tested it in cmd and with a Powershell script where I did not change to the application's home directory and the program ran and started the proper window. However if I use the above command in FSUIPC I get the 267, invalid directory error. I also tried this command Run2=READY,CLOSE,Powershell "-command C:\Users\NAME\AppData\Local\FS-Keypad\FS-Keypad.exe C:\Users\NAME\AppData\Local\FS-Keypad\Keypads\303df744-c367-4681-a409-4ac2f187b39e.json" I'm not sure what is going on but a workaround is to finish something I was going to do a while back until I found the FSUIPC Run section. I'll create a script and have it run what I need. I assume that to run a Powershell command I can use the syntax Run2=powershell "-command Mycommandhere" From the command line this would be powershell -command Mycommandhere where Mycommand here is a Powershell command file.
aua668 Posted July 20, 2021 Report Posted July 20, 2021 Hi, That's how I run my programs without any problems: [Programs] RunIf1=AM=2,READY,CLOSE,"C:\Users\Reinhard\AppData\Local\vPilot\vPilot.exe -host" RunIf2=AM=2,READY,DELAY,"C:\AviaServer\AviaServer.exe" I enclose my command including parameters completely by quotes. Rgds Reinhard
DakotaPilot Posted July 20, 2021 Author Report Posted July 20, 2021 Yup. and I do that with another program but for some reason when I do as above (and any of the combinations discussed) the FSUIPC log shows a error about the directory and file yet the application will run from any directory when it's done from a command window or Powershell script. Strange.
Pete Dowson Posted July 20, 2021 Report Posted July 20, 2021 On 7/18/2021 at 4:23 AM, DakotaPilot said: -I've used the Programs section of the FSUIPC ini file to run some programs and it works well. I am now trying to run another program but keep ending up with an error 237. the entries in the Program section are. I'm on FSUIPC 6. Run2=READY,CLOSE,C:\Users\NAME\AppData\Local\FS-Keypad\FS-Keypad.exe C:\Users\NAME\AppData\Local\FS-Keypad\Keypads\303df744-c367-4681-a409-4ac2f187b39e.json Run3=READY,CLOSE,C:\Users\NAME\AppData\Local\FS-Keypad\FS-Keypad.exe C:\Users\NAME\AppData\Local\FS-Keypad\Keypads\d221813d-fb88-4233-a6c6-c7491de17616.json and the fsuipc.log has this in it. 31437 FSUIPC couldn't run: "C:\Users\NAME\AppData\Local\FS-Keypad\FS-Keypad.exe C:\Users\NAME\AppData\Local\FS-Keypad\Keypads\303df744-c367-4681-a409-4ac2f187b39e.json" [Error=267] 31437 FSUIPC couldn't run: "C:\Users\NAME\AppData\Local\FS-Keypad\FS-Keypad.exe C:\NAME\Brett\AppData\Local\FS-Keypad\Keypads\d221813d-fb88-4233-a6c6-c7491de17616.json" [Error=267] Is your logon name to Windows really "NAME"? That seems really unlikely. Your log-on name should be there instead. The error means bad folder name so something there is wrong. You could try replacing the C:\Users\NAME\AppData part by %AppData% Pete
DakotaPilot Posted July 20, 2021 Author Report Posted July 20, 2021 Nope. I replaced my name with NAME. In the ini file it's correct. I copied the string from the application's shortcut that it created. It's weird. The same line works fine in a command window or from a Powershell script no matter what directory the script or command window is in.
DakotaPilot Posted July 20, 2021 Author Report Posted July 20, 2021 I did some more testing and I can run the program if I do this. Run2=READY,CLOSE,C:\Users\Brett\AppData\Local\FS-Keypad\FS-Keypad.exe As soon as I add an argument it fails saying it can't find the directory but it works from the command line window or a Powershell script. At this point I'll start them manually or do something else. I did try running the above but with <PathtoPowershell>powershell.exe which works but as soon as I add a paramater such as "-command <pathtoprog>\script.ps1" I get the 267 error.
John Dowson Posted July 21, 2021 Report Posted July 21, 2021 @DakotaPilot and @aua668 there is definitely something strange going on with the run programs command with arguments. I will look into this and get back to you. However, this may take a while - I'll post back here when I find out anything useful. John 1
John Dowson Posted July 22, 2021 Report Posted July 22, 2021 Could you you the attached version please. Note that the program must always be wrapped in double quotes if it takes parameters. FSUIPC7.exe
John Dowson Posted July 22, 2021 Report Posted July 22, 2021 Sorry - you are on FSUIPC6 not 7! I will update in FSUIPC6 and post shortly. John
John Dowson Posted July 22, 2021 Report Posted July 22, 2021 Here's the FSUIPC6 version, v6.1.3a: FSUIPC6.dll
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