mIRC Home    About    Download    Register    News    Help

Print Thread
#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?

firefox #230014 22/02/11 05:19 PM
Joined: Sep 2006
Posts: 59
R
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

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


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #230025 22/02/11 08:24 PM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
The -n switch only minimizes the window but won't hide it.

Tomao #230031 22/02/11 10:14 PM
Joined: Oct 2004
Posts: 8,330
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
Riamus2 #230032 22/02/11 10:27 PM
Joined: Sep 2005
Posts: 2,881
H
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

hixxy #230035 23/02/11 01:49 AM
Joined: Oct 2003
Posts: 3,918
A
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"
hixxy #230038 23/02/11 02:40 AM
Joined: Jul 2007
Posts: 1,129
T
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.

Tomao #230050 23/02/11 08:05 AM
Joined: Sep 2005
Posts: 2,881
H
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.

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

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


Link Copied to Clipboard