Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need the following:

1. I want to open a new command prompt window with PERL script
2. Run the remaining PERL script on that window.

How to do this?

Please answer me if you know.

this is very urgent help me............
Posted
Updated 27-Sep-11 20:19pm
v3

1 solution

You may need to be more specific about your goals, but from what you've said, I do not think you can have a single script execute partly in one CMD window and partly in another one in the way you mention. If you want multiple versions of a script operating you should look into fork[^]which will let you create a new child process running the same script from the same point as the original parent. Note that this requires some care in what you are doing to keep the various copies coordinated and controlled!


However you could have one script create a shell that then executes another script, something like this trivial example:

perl -e "system 'start CMD /k perl -v'"

If you run that as a command at your CMD prompt, it will open a new independent CMD window and cause it to run Perl with the -v option, and then remain open afterwards (or use /c to close after the run - check HELP CMD for other options). You could replace the -v with the name of another Perl script to execute.

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900