How to pass file names with spaces to Perl drop target in Windows

Viewed 60

I have set up Strawberry Perl pl scripts as drop target using Michael's answer How do I make my Perl scripts act like normal programs on Windows?

(I wrote small script for this, because after Strawberry Perl upgrade re-registration is required: https://gist.github.com/Vlado-99/b437cc6cc2ea764b1f74d4f2b8404102).

If I drop "simple" file name, like "report.txt", my script receives "report.txt".

But if I drop long file name, like "report for 2020-01 (sorted).txt", my scripts gets

ARGV[0]='report'
ARGV[1]='for'
ARGV[2]='2020-01'
ARGV[3]='(sorted).txt'

and if I drop name like "C:\PlexLibrary\Chisum (1970)\Chisum(1970).mp4", script gets

ARGV[0]='C:\PLEXLI~1\Chisum'
ARGV[1]='(1970)\Chisum(1970).mp4'

How to:

  1. Prevent filenames broken to more parts,
  2. Prevent use of short DOS 8.3 names instead of Windows long names?

My filesystem is NTFS, Windows is 64-bit Windows 7 Professional, Perl is

C:\>perl --version

This is perl 5, version 30, subversion 2 (v5.30.2) built for MSWin32-x64-multi-thread

Copyright 1987-2020, Larry Wall
0 Answers
Related