Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: windows shortcut and args

by enrgyxprt (Acolyte)
on Jan 15, 2017 at 22:52 UTC ( [id://1179612]=note: print w/replies, xml ) Need Help??


in reply to Re: windows shortcut and args
in thread windows shortcut and args

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)

Replies are listed 'Best First'.
Re^3: windows shortcut and args
by huck (Prior) on Jan 15, 2017 at 23:45 UTC

    What does "assoc .blt" say?

      Almost had a Doh! moment... but after </p.

      C:\WINDOWS\system32>assoc .blt=C:\Perl Builder2\RemLaunch.pl .blt=C:\Perl Builder2\RemLaunch.pl
      I still get "This app cant run on your pc"...

        how about

        ftype PerlRemlaunch=c:\perl64\bin\perl5.16.3.exe "C:\Perl Builder2\Rem +Launch.pl" "%1" assoc .blt=PerlRemlaunch
        or maybe
        assoc .blt=c:\perl64\bin\perl5.16.3.exe C:\Perl Builder2\RemLaunch.pl +"%1"
        I think you were expecting a level of redirection that isnt there. "C:\Perl Builder2\RemLaunch.pl" isnt an executable type (exe,com,...)

        Hi,

        Why do you expect that to work?

        The path has spaces but is not quoted

        There is no wildcard thing for @ARGV

        Perl.exe isn't mentioned, and I only mention this because I've no idea how many levels of indirection ftype/assoc like to expand in what they consider an executable... and you'll have to do the checking so you should know what to do if quoting the full path to the .pl doesn't work

Re^3: windows shortcut and args
by poj (Abbot) on Jan 17, 2017 at 19:08 UTC

    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: note [id://1179612]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-23 20:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found