Perl more comand start giving error after upgrading to windows to 1803 version. It worked fin with windows 1709,1703,1609 ver

Posted by akshaygparab on 2018-08-06 10:42

code which start giving Too many arguments in command line after upgradign to windows 1803 version. This same code work fine with windows 1709 version

my $syscmd="more $tppath\\IMP-name-Title.txt >> $Namelist";
system($syscmd);

Error on console:
more template\IMP-name-Title.txt >> temp-Name\Namelist.txt
Too many arguments in command line.

Anyone knows solutiuon for this issue.

grahams
ActiveState Staff
Wed, 2018-08-08 12:28

The error is coming from Windows.
It seems like it might be a length problem. Check what your max path is set for:
https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file

It would only be a Perl problem if your Perl variables will not always use valid characters for Windows file and directory names.

akshaygparab | Wed, 2018-08-08 15:45

I tried to run the same syntax on 1803 and also on 1709 windows 10 system. on windows running with 1803 version giving me the same error message "Too many arguments in command line." on the other hand its running without any error message on 1709 version. To avoid maximum path lenth I'm running both command on C:\

Windows 1803 output:

C:\>more Datetime.txt >> calender.txt
Too many arguments in command line.

Windows 1709 output:

c:\>more Datetime.txt >> calender.txt

c:\>

akshaygparab | Fri, 2018-08-10 12:35

I used /E after more command and its star working.

C:\Users>more /E IPinfo.txt >> test.txt

Thnkas,
Akshay Parab