|
| Author |
Message |
Cheater Senior Member

Joined: 10 Jun 2005 Posts: 236
  
|
Posted: Fri Jul 15, 2005 8:39 pm Post subject: System Commands |
|
|
| I know there are ways to execute system commands from perl (DOS Commands). How would I go about launching an application. Let's use Notepad and MS Paint as examples. How would I go about launching them through a perl script, but keep the perl script running? On the same topic, how do I change the color the text prints in in the DOS Window? One last thing, does anyone here know any other cool DOS commands that can be executed in Perl? |
|
| Back to top |
|
 |
mattaustin Sentinel

Joined: 19 Jul 2004 Posts: 556 Location: Los Angeles, CA
  votes: 1
|
|
| Back to top |
|
 |
Cheater Senior Member

Joined: 10 Jun 2005 Posts: 236
  
|
Posted: Fri Jul 15, 2005 9:49 pm Post subject: |
|
|
I just tried something in DOS. I tried typing "start notepad" and it launched it. Then I typed "notepad" and it launched it. I'll have to test them in my script when I get to my other computer (with perl)
and I'll also test that ansi thing |
|
| Back to top |
|
 |
malefactor Member

Joined: 27 Jan 2005 Posts: 109 Location: Lewiston, ME
  
|
Posted: Sun Jul 17, 2005 10:40 pm Post subject: |
|
|
| interesting... Just out of curiousity what are you planning on doing with this? |
|
| Back to top |
|
 |
Cheater Senior Member

Joined: 10 Jun 2005 Posts: 236
  
|
Posted: Mon Jul 18, 2005 1:15 am Post subject: |
|
|
| If you want to know what I need it for, PM/E-Mail me. I don't want to post it here since some people will go ahead and beat me in releasing it, and I really want to be the one to release this one. |
|
| Back to top |
|
 |
darkmonkey The Merovingian

Joined: 18 Apr 2004 Posts: 2557 Location: London, England
     votes: 7
|
Posted: Mon Jul 18, 2005 7:51 am Post subject: |
|
|
Well you do know that it will only open on your system, and not the users', don't you? _________________ ~ Josh
[ Need bot hosting on a dedicated server? PM me. ] |
|
| Back to top |
|
 |
Cheater Senior Member

Joined: 10 Jun 2005 Posts: 236
  
|
Posted: Mon Jul 18, 2005 11:50 am Post subject: |
|
|
| Yes I do. That is what I want it to do. |
|
| Back to top |
|
 |
Cer Upgraded Agent

Joined: 03 Feb 2004 Posts: 3776 Location: Michigan
  votes: 4
|
Posted: Mon Jul 18, 2005 3:30 pm Post subject: |
|
|
It's kind of pointless. The only thing I've used a launch Notepad thing for was in debugging, when LWP::Simple'ing a website.
| Code: | my $src = LWP::Simple::get "http://some.site/page";
open (DEBUG, ">C:/debug.txt");
print DEBUG $src;
close (DEBUG);
system ("start notepad.exe C:/debug.txt"); |
_________________ Current Site (2008) http://www.cuvou.com/ |
|
| Back to top |
|
 |
mattaustin Sentinel

Joined: 19 Jul 2004 Posts: 556 Location: Los Angeles, CA
  votes: 1
|
Posted: Mon Jul 18, 2005 3:32 pm Post subject: |
|
|
| from what i understand i dont think he was opening notepad...he just wanted an example. |
|
| Back to top |
|
 |
Cer Upgraded Agent

Joined: 03 Feb 2004 Posts: 3776 Location: Michigan
  votes: 4
|
Posted: Mon Jul 18, 2005 3:35 pm Post subject: |
|
|
But on this topic, something else that's quite useful sometimes is opening a webpage.
| Code: | | system ("start http://bot-depot.com/"); |
Opens bot-depot.com without having to first open a DOS window (the alternative is to do this:)
| Code: | | system ("start \"C:/Program Files/Internet Explorer/IEXPLORE.EXE\" http://bot-depot.com/"); |
But that causes a DOS window to pop up for a second (or something like that, in my experience). _________________ Current Site (2008) http://www.cuvou.com/ |
|
| Back to top |
|
 |
Cheater Senior Member

Joined: 10 Jun 2005 Posts: 236
  
|
Posted: Mon Jul 18, 2005 8:12 pm Post subject: |
|
|
| mattaustin wrote: | | from what i understand i dont think he was opening notepad...he just wanted an example. | Actually, I am using it for both. I need to open Notepad AND some other applications. For my "Project" (which I am having some problems with, PM for details) |
|
| Back to top |
|
 |
darkmonkey The Merovingian

Joined: 18 Apr 2004 Posts: 2557 Location: London, England
     votes: 7
|
Posted: Mon Jul 18, 2005 8:42 pm Post subject: |
|
|
We aren't going to PM you to give you help. The way it works if you post, and we help you like that. Quite an easy system, once you get used to it. _________________ ~ Josh
[ Need bot hosting on a dedicated server? PM me. ] |
|
| Back to top |
|
 |
Cheater Senior Member

Joined: 10 Jun 2005 Posts: 236
  
|
|
| Back to top |
|
 |
mattaustin Sentinel

Joined: 19 Jul 2004 Posts: 556 Location: Los Angeles, CA
  votes: 1
|
Posted: Mon Jul 18, 2005 9:22 pm Post subject: |
|
|
| system ("start http://bot-depot.com/"); is smart to open a wev page also because it opens it in the users default browser....weather it be firefox or ie. |
|
| Back to top |
|
 |
malefactor Member

Joined: 27 Jan 2005 Posts: 109 Location: Lewiston, ME
  
|
Posted: Tue Jul 19, 2005 8:33 pm Post subject: |
|
|
| Cheater wrote: | | If you want to know what I need it for, PM/E-Mail me. I don't want to post it here since some people will go ahead and beat me in releasing it, and I really want to be the one to release this one. |
If you are gonna post it eventually anyway, I will just wait and see.
I was just curious about what you are doing because I could think of any way that this would be usefull.
Only use for this kind of command that I could think of would be starting an FTP server or something like that, but then you would need one that could be shut down via the command prompt as well for it to be truly usefull |
|
| Back to top |
|
 |
|