|
Joined: Sep 2007
Posts: 202
Fjord artisan
|
OP
Fjord artisan
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?
|
|
|
|
Joined: Dec 2008
Posts: 1,515
Hoopy frood
|
Hoopy frood
Joined: Dec 2008
Posts: 1,515 |
You can use The -n switch minimizes the window of the application being run.
|
|
|
|
Joined: Jul 2007
Posts: 1,129
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,129 |
The -n switch only minimizes the window but won't hide it.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
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
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
You can do this with the wscript.shell COM object: 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"
|
|
|
|
Joined: Oct 2003
Posts: 3,918
Hoopy frood
|
Hoopy frood
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"
|
|
|
|
Joined: Jul 2007
Posts: 1,129
Hoopy frood
|
Hoopy frood
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.
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
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: //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.
|
|
|
|
Joined: Jul 2007
Posts: 1,129
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,129 |
That's got it. Thanks much for the explanation, hixxy.
|
|
|
|
Joined: Sep 2007
Posts: 202
Fjord artisan
|
OP
Fjord artisan
Joined: Sep 2007
Posts: 202 |
You can do this with the wscript.shell COM object: 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" thanks hixxy
|
|
|
|
|