mIRC Home    About    Download    Register    News    Help

Print Thread
/run command #230013 22/02/11 05:16 PM
Joined: Sep 2007
Posts: 202
F
firefox Offline OP
Fjord artisan
OP Offline
Fjord artisan
F
Joined: Sep 2007
Posts: 202
/run C:\Windows\System32\cmd.exe /c $1

closes the window after running the commands

Can I make it so the window doesn't show at all?

Re: /run command [Re: firefox] #230014 22/02/11 05:19 PM
Joined: Sep 2006
Posts: 59
R
Rewtor Offline
Babel fish
Offline
Babel fish
R
Joined: Sep 2006
Posts: 59
I needed this a while back, I think this is what you're looking for: http://www.ntwind.com/software/utilities/hstart.html

Re: /run command [Re: Rewtor] #230015 22/02/11 05:47 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
You can use
Code:
The -n switch minimizes the window of the application being run.

Re: /run command [Re: westor] #230025 22/02/11 08:24 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
The -n switch only minimizes the window but won't hide it.

Re: /run command [Re: Tomao] #230031 22/02/11 10:14 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
True, but I believe that's about the best you can do without running another program that doesn't come with Windows.


Invision Support
#Invision on irc.irchighway.net
Re: /run command [Re: Riamus2] #230032 22/02/11 10:27 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
You can do this with the wscript.shell COM object:

Code:
alias runex {
  .comopen runex wscript.shell
  if (!$comerr) { .comclose runex $com(runex,run,3,bstr,$1-,int,0,bool,$false) }
}


This completely hides the window, it doesn't just minimise it.

As an added benefit, if you want the script to wait until the program has finished executing before continuing, change "bool,$false" to "bool,$true" smile

Re: /run command [Re: hixxy] #230035 23/02/11 01:49 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Also see exec.dll for a way to silently run programs, as well as capture their output.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: /run command [Re: hixxy] #230038 23/02/11 02:40 AM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
hixxy, I gave it a shot trying /runex file.txt but nothing happens. Isn't it supposed to open file.txt for me without showing the window?

I also try running programs with .exe extension but nothing happens too.

Re: /run command [Re: Tomao] #230050 23/02/11 08:05 AM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
You need to supply the full path to the file, and nothing will happen because the window is hidden. If I do this:

Code:
//write x.txt test | runex $qt($mircdirx.txt)


And then check in the task manager processes tab, I can see "notepad.exe" running, but there is no window because it's hidden.

Re: /run command [Re: hixxy] #230053 23/02/11 09:04 AM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
That's got it. Thanks much for the explanation, hixxy.

Re: /run command [Re: hixxy] #230151 26/02/11 01:52 PM
Joined: Sep 2007
Posts: 202
F
firefox Offline OP
Fjord artisan
OP Offline
Fjord artisan
F
Joined: Sep 2007
Posts: 202
Originally Posted By: hixxy
You can do this with the wscript.shell COM object:

Code:
alias runex {
  .comopen runex wscript.shell
  if (!$comerr) { .comclose runex $com(runex,run,3,bstr,$1-,int,0,bool,$false) }
}


This completely hides the window, it doesn't just minimise it.

As an added benefit, if you want the script to wait until the program has finished executing before continuing, change "bool,$false" to "bool,$true" smile
thanks hixxy