Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

windows shortcut and args

by enrgyxprt (Acolyte)
on Jan 15, 2017 at 19:47 UTC ( [id://1179602]=perlquestion: print w/replies, xml ) Need Help??

enrgyxprt has asked for the wisdom of the Perl Monks concerning the following question:

I want windows to open all files with the extension of .bll (Which are text based files) with my perl script. Does windows pass the pathtofile.filename.bll to my script in @ARG ? If not then how can I access this in my script ?

Replies are listed 'Best First'.
Re: windows shortcut and args
by soonix (Canon) on Jan 15, 2017 at 20:12 UTC

      Thank you, I thought @ARGV, typed it wrong.. But your response answered my question, ty...

      Unfortunately, I hoped for too much, too soon and too quick...

      I have set my file extension .blt to open myscript.pl

      I have set the following,

      C:\WINDOWS\system32>assoc .pl=PerlScript C:\WINDOWS\system32>ftype PerlScript PerlScript=c:\perl64\bin\perl5.16.3.exe "%1" %*

      But double clicking a .blt gets me the dreaded "This app cant run on your pc"

      Im running windows 10. Tried disabling SmartScreen, stil no joy...

      May be Im not thinking clearly. Heres the poop..

      I have a program I use for work. It creates txt based files. The program gets updated frequently. Because the updates affect how some things are calculated, we are allowed to open older projects with the version software that created them.

      I have hundreds of projects created by close to 16 different versions of software.

      New software wants to update old files, and we cant have that. Old software cant open new files. Im forced to use the windows preview pane, looking at the 3rd line in any .blt file tells me which version created that file. Now I have to start the correct exe and finally use the file open function.

      Its been 5 years since I was able to double click a file and have it open every time...

      SO.. I wanted to make a "smart shortcut script" .... associate .blt with mylauncher.pl, double click any .blt file, have mylauncher.pl grab the 3rd line in the .blt then use a hash filled with a few Versions and exe correct paths. at some point use something like `prog.exe`

      Any and ALL help will be rewarded (May be, even in this lifetime lol)

        What does "assoc .blt" say?

        Maybe use Win32::Shortcut to create a shortcut for each file to the appropriate exe

        poj

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1179602]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-18 01:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found