kungfusnwbrdr
Technical User
Okay, so I will admit that I'm a VBScript newb at this point. I've written a wrapper script to run another program for me and to create a lock file while that program is running to prevent other users from accessing the program at the same time.
I've compiled the VBScript into an EXE and it grabs the path to the program from an INI file located in the same directory as the VBScript in EXE form. The VBScript EXE is in its own directory, which is in the PATH before the actual program it is running. When the user launches the program from the shortcuts it works just fine. If the user attempts to run the program from the Run window or a command window, however, it can't find the INI file.
I believe what is happening is the PATH where the command is run from is somehow being passed to the script. I could specify the absolute path in the script, but I wanted to avoid that if possible to make it as portable in the EXE form as possible (hence the INI file). Is there an easy way for the VBScript in EXE form to find its own directory and locate the INI file in that path and to place the lock file in the same path?
I've compiled the VBScript into an EXE and it grabs the path to the program from an INI file located in the same directory as the VBScript in EXE form. The VBScript EXE is in its own directory, which is in the PATH before the actual program it is running. When the user launches the program from the shortcuts it works just fine. If the user attempts to run the program from the Run window or a command window, however, it can't find the INI file.
I believe what is happening is the PATH where the command is run from is somehow being passed to the script. I could specify the absolute path in the script, but I wanted to avoid that if possible to make it as portable in the EXE form as possible (hence the INI file). Is there an easy way for the VBScript in EXE form to find its own directory and locate the INI file in that path and to place the lock file in the same path?