win32::process problem

2007-11-29 Thread Spencer Chase
Greetings ,

I know that everyone likes a working or not working total script. In this case 
it is not
going to be easy for someone else to test so I will start with just a snip and 
try to
explain the problem. I can send a whole script but it would require installing 
programs
and text files etc. to really test it. I will send the mess of a script (I tend 
to write
really rambling garbage with the hope of cleaning it up some day and rarely do) 
to anyone
who does want to install the required program etc.

 Win32::Process::Create( my $process,
$player,
$play_file,
0,
DETACHED_PROCESS,
.) || die Create: $!;

I am using win32::process as above. I need to start an application that, 
unfortunately is
in the following location:
C:\Program Files\vanBasco's Karaoke Player\vmidi.exe  It has both a ' and 
spaces in it so
I can not figure out how to treat it in  or '' strings. I read the path from 
a text file
just as it is above and assign this to the variable $player the other variable 
$play_file
is a MIDI file that the application will open and is in the working directory 
although it
can also have a path added to it. The above snip of code works fine on one 
computer (the
one I am developing it on) but not on another win xp machine. I get an error 
from die
since the process can not be created. I have tried all sorts of combinations of 
 ''
single and double \\ / \' for the ' in the path, thinking that I might get 
something that
works on both computers. I can only get it to work by reading C:\Program 
Files\vanBasco's
Karaoke Player\vmidi.exe from a text file (a config file) and assigning it to 
$player.It
may also be that permission is needed to start a process but I thought I was 
avoiding this
by using win32::process.

Should the name of the process as used above work on all win computers? It it 
just a
permission problem? If so, what can I do to assure that I can run this 
application on
other computers not knowing what permissions and passwords are in effect?

--
Best regards,
Spencer Chasemailto:[EMAIL PROTECTED]
67550 Bell Springs Rd.
Garberville, CA 95542  Postal service only.
Laytonville, CA 95454  UPS only.
[EMAIL PROTECTED]
http://www.spencerserolls.com
http://www.spencerserolls.com/MidiValve.htm
(707) 984-8356

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: win32::process problem

2007-11-29 Thread Mark Dootson
Hi,

It may have nothing to do with paths.

Your '$play_file' param needs to be

vmidi.exe path_to_midi_file.

It currently works on one machine because 
C:\Program Files\vanBasco's Karaoke Player\vmidi.exe is registered with shell 
to execute MIDI files. 
On the machine where it does not work, either it isn't, or something else 
prevents shellexecute from working.

In any case, 3rd param should be a command line so you need to include the exec 
name. (not the full path to the exec).

Regards

Mark





Spencer Chase wrote:
 Greetings ,
 
 I know that everyone likes a working or not working total script. In this 
 case it is not
 going to be easy for someone else to test so I will start with just a snip 
 and try to
 explain the problem. I can send a whole script but it would require 
 installing programs
 and text files etc. to really test it. I will send the mess of a script (I 
 tend to write
 really rambling garbage with the hope of cleaning it up some day and rarely 
 do) to anyone
 who does want to install the required program etc.
 
  Win32::Process::Create( my $process,
 $player,
 $play_file,
 0,
 DETACHED_PROCESS,
 .) || die Create: $!;
 
 I am using win32::process as above. I need to start an application that, 
 unfortunately is
 in the following location:
 C:\Program Files\vanBasco's Karaoke Player\vmidi.exe  It has both a ' and 
 spaces in it so
 I can not figure out how to treat it in  or '' strings. I read the path 
 from a text file
 just as it is above and assign this to the variable $player the other 
 variable $play_file
 is a MIDI file that the application will open and is in the working directory 
 although it
 can also have a path added to it. The above snip of code works fine on one 
 computer (the
 one I am developing it on) but not on another win xp machine. I get an error 
 from die
 since the process can not be created. I have tried all sorts of combinations 
 of  ''
 single and double \\ / \' for the ' in the path, thinking that I might get 
 something that
 works on both computers. I can only get it to work by reading C:\Program 
 Files\vanBasco's
 Karaoke Player\vmidi.exe from a text file (a config file) and assigning it to 
 $player.It
 may also be that permission is needed to start a process but I thought I was 
 avoiding this
 by using win32::process.
 
 Should the name of the process as used above work on all win computers? It it 
 just a
 permission problem? If so, what can I do to assure that I can run this 
 application on
 other computers not knowing what permissions and passwords are in effect?
 
 --
 Best regards,
 Spencer Chasemailto:[EMAIL PROTECTED]
 67550 Bell Springs Rd.
 Garberville, CA 95542  Postal service only.
 Laytonville, CA 95454  UPS only.
 [EMAIL PROTECTED]
 http://www.spencerserolls.com
 http://www.spencerserolls.com/MidiValve.htm
 (707) 984-8356
 
 ___
 Perl-Win32-Users mailing list
 Perl-Win32-Users@listserv.ActiveState.com
 To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Win32::Process problem!

2001-11-19 Thread Petru Grindean

Hi folks!

I need your help! I want write one Perl script that run one other process!
Ok! I made that! But it's a problem! The process takes some minutes to
complete, and I run the script in CGI environment. I want while the
process is running to put one message on the screen, which warning the
user: the process is running! pls. wait! When the process is done, I want
the results displayed on the screen.

Anybody know how I can do it? I tryed with fork(), but it don't work!
Can you send me one amazing idea and one short example?

Thank's in advance!

Peter.

__
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users