#!perl.exe

$name="C:\\perl test\\perl text.txt";
`"$name"`;

....runs Notepad with the txt file under Windows 2000.

The double quotes in `"$name"`; are needed for cmd.exe due to the spaces.

/g

> -----Original Message-----
> From: Rubiniec, Krzysztof [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 30, 2001 1:49 AM
> To: '[EMAIL PROTECTED]'
> Subject: Calling external executable with parameter under WinNT.
> 
> 
> 
> Hi, anybody knows why I can't call external executable with a parameter
> under WinNT (I use cmd "shell"). The parameter is a name of file containing
> spaces, and that's probably the source of problems. I have been trying to do
> that in many ways, but none of them works.
> 
> # for instance
> 
> $batch = 'C:/Program Files/Logictran/r2net.exe';
> $name = 'SPM Change Control_1.rtf';
> system($batch, $name)==0 or die "No way!\n";
> 
> # also
> 
> $batch="\"C:\\Program Files\\Logictran\\r2net.exe\"";
> $name="C:\\www for SDC\\SPM Change Control_1.rtf";
> # or
> $name='"C:\\www for SDC\\SPM Change Control_1.rtf"';
> 
> @lines=`$batch $name`;
> #or
> system($batch, $name)==0 or die "No way!\n";
> 
> 
> when I use no parameter the .exe file is called right (although it's name
> also include spaces).
> 
> How to do that?
> Thank you in advance
> Krzysztof
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to