kisstom Posted October 2, 2018 Share Posted October 2, 2018 Hi, If I have a script (zipviewer.au3 for example) associated with .zip files how can I get the path the file called from? For example if I have a 'C:\test.zip' file , right click on it and choose open with zipviewer.au3, my script runs and I need the path and file name 'C:\test.zip'. Sorry, for my English Link to comment Share on other sites More sharing options...
kisstom Posted October 2, 2018 Author Share Posted October 2, 2018 OK, I figured out this: Send("^c") $FilePath = ClipGet() ToolTip ($FilePath) Sleep (2000) ToolTip("") Exit But I'm quite sure there is more elegant solution(s) Link to comment Share on other sites More sharing options...
Subz Posted October 2, 2018 Share Posted October 2, 2018 (edited) You should compile the .au3 file as an executable, then you can use $CmdLine or $CmdLineRaw to capture the path for example: Compile the following as an zxt.exe If $CmdLine[0] >= 1 Then MsgBox(4096, "CmdLine", $CmdLine[1]) Create a file named File.zxt (for testing purposes only) Right Click the file and Select OpenWith select zxt.exe. It should now pop up with the path to the zxt file extension. Hope that makes sense. Edited October 2, 2018 by Subz Link to comment Share on other sites More sharing options...
kisstom Posted October 2, 2018 Author Share Posted October 2, 2018 That's it! Thank you. Link to comment Share on other sites More sharing options...
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