mIRC Home    About    Download    Register    News    Help

Print Thread
#230013 22/02/11 05:16 PM
F
firefox
firefox
F
/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?

#230014 22/02/11 05:19 PM
R
Rewtor
Rewtor
R
I needed this a while back, I think this is what you're looking for: http://www.ntwind.com/software/utilities/hstart.html

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

westor #230025 22/02/11 08:24 PM
Joined: Jul 2007
Posts: 1,124
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,124
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,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
True, but I believe that's about the best you can do without running another program that doesn't come with Windows.

Riamus2 #230032 22/02/11 10:27 PM
Joined: Sep 2005
Posts: 2,630
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,630
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,641
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,641
Also see exec.dll for a way to silently run programs, as well as capture their output.

hixxy #230038 23/02/11 02:40 AM
Joined: Jul 2007
Posts: 1,124
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,124
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,630
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,630
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,124
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,124
That's got it. Thanks much for the explanation, hixxy.

hixxy #230151 26/02/11 01:52 PM
F
firefox
firefox
F
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