"Bakken, Luke" wrote:
> > I want to know if I can open a dos command console and run a
> > command on
> > it (i.e. dir or cd $some_dir) with the Win32::Process module. I used
> > the following code but the command didn't get pass into the new dos
> > console that it opened.
>
> If I remember correctly, dir and cd are built-in to the cmd shell. So
> you would have to do something like this for your command:
>
> cmd /c "cd somedir"
> cmd /c "dir somedir"
>
> Luke
Might be better to use the /K switch, since this leaves the console open.
cmd /k "cd somedir"
cmd /k "dir somedir"
E:\d_drive\perlStuff\guests>cmd /?
Starts a new instance of the Windows 2000 command interpreter
CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF]
[[/S] [/C | /K] string]
/C Carries out the command specified by string and then terminates
/K Carries out the command specified by string but remains
Unfortunately, it does NOT seem to open a new window if run from a console. It simply
runs the command in place. It will spawn a window, though, if run from the
single-line "Run" utility on the Start menu.
Joseph
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]