Is there a way to capture the path to last file user tried to open (Wise/VBScript)
Hi,
This is the scenario I am trying to script:
1) User double clicks on a file test.jt
2) I have to display a message box to the user before the file is opened.
I will associate the .jt file extension with the application I write in WiseScript Editor to display the message box to the user.
After the user clicks "OK" on the message box, I want to open the file the user clicked on with the program that is supposed to open files with extension .jt.
The problem I am running into is that I cannot figure out how to get the path to the file the user clicked on. Windows uses "%1" to pass this path to programs, but I haven't been able to figure out a way to expand this variable or use it in any way. Does anyone know of a solution?
-- Thanks
This is the scenario I am trying to script:
1) User double clicks on a file test.jt
2) I have to display a message box to the user before the file is opened.
I will associate the .jt file extension with the application I write in WiseScript Editor to display the message box to the user.
After the user clicks "OK" on the message box, I want to open the file the user clicked on with the program that is supposed to open files with extension .jt.
The problem I am running into is that I cannot figure out how to get the path to the file the user clicked on. Windows uses "%1" to pass this path to programs, but I haven't been able to figure out a way to expand this variable or use it in any way. Does anyone know of a solution?
-- Thanks
0 Comments
[ + ] Show comments
Answers (4)
Please log in to answer
Posted by:
anonymous_9363
14 years ago
Posted by:
Nomi1985
14 years ago
That's the thing I'm running up against. The only way for me to display the message box I need to present to the user is to re-associate the extension with my message box EXE file. Then I want the message box to open up the file with the program that is really supposed to open it. Maybe I'm going about this the wrong way but I can't think of how else I would do it.
Posted by:
anonymous_9363
14 years ago
Reading between the lines, it sounds like you want to present the path as text in the message box. Do I have that right? If so, this Windows API will get a file's path. Be warned that getting APIs to work in WiseScript is enormous fun.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.