Your line below will not work:
my $dos = Win32::OLE->new('Cmd.application') or die "oops\n";
$dos->{visible} = 1;
Why? Because
Cmd.application is not a registerred class and OLE does not know what to do with it.
As to why 'Cmd.application' is not a registerred OLE class, I guess it's because of security issues, imagine openning a file with embedded object that invokes your CMD.exe and delete files...
There are perl equivalents to what you wanted to do on the local machine -
dir: opendir
cd: chdir
ipconfig: qx(PATH/ipconfig.exe)
And you don't want to allow execution of DOS commands remotely, too much security concerns.
I guess one thing you could do is to install trusted remote
clientsservers that listen on TCP ports, and execute commands based on remote requests. One such client we are using here is
On Command Remote which allows you to remotely issue command and install programs, etc...
Worse comes to worst, you can always roll your own client/server systems.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.