Is there a way to capture the path to last file user tried to open (Wise/VBScript)


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)

Posted by: anonymous_9363 13 years ago
Red Belt
Why do you need to know the path? If the association is set up correctly, the relevant program will open the file anyway.
Posted by: Nomi1985 13 years ago
Senior Yellow Belt
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: Bobo 13 years ago
Orange Belt
In VBScript it's WScript.Arguments.Named you use.
Posted by: anonymous_9363 13 years ago
Red Belt
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.
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ