12/09/2009 2281 views

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


Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

All Answers

Why do you need to know the path? If the association is set up correctly, the relevant program will open the file anyway.
Answered 12/10/2009 by: VBScab
Red 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.
Answered 12/10/2009 by: Nomi1985
Senior Yellow Belt

In VBScript it's WScript.Arguments.Named you use.
Answered 12/11/2009 by: Bobo
Orange 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.
Answered 12/11/2009 by: VBScab
Red Belt