views:

49

answers:

1

Hi. I want to program in Perl a very basic program but I'm having some questions about how to do it. I'll keep it simple: I want a perl script that when number 1 is pressed a new "cmd.exe" is opened and the "dir" command is executed, and when 2 is pressed a new "cmd.exe" is opened and the command "cd" is executed.

The place where I'm having the problems is in opening a NEW "cmd.exe" instead of the same cmd that executes the perl script.

Some ideas? Thanks a lot

+1  A: 

If i understand it correct,what you want is to open a new window of cmd.exe and want to execute dir or cd command.is it? Then i think you can use following command to get it donw

start cmd /K dir this command will execute "dir" command but won't close the new command window...

start cmd /C dir this command will execute the dir command and terminate the new command window.

Anil Vishnoi
Anil, you have understood perfectly. It works great! Thank you.
@user354427 You haven't replied to @gamen question as i am also willing to know how you are trying. Any way, if you are satisfy with answer given by @Anil then pl. accept it
ppant