Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Hide CMD Window


  • Please log in to reply
12 replies to this topic
niceuneasy
  • Members
  • 63 posts
  • Last active: Oct 01 2014 01:15 AM
  • Joined: 28 Apr 2013

Hi is it possable to hide cmd window from appearing when i use

f9::run  ipconfig/release  thanks again for quick responcegrin.png



tidbit
  • Administrators
  • 2709 posts
  • Hates playing Janitor
  • Last active: Jan 15 2016 11:37 PM
  • Joined: 09 Mar 2008

Please read the documentation for the Run command.

http://i.imgur.com/wEtSvp5.png

wEtSvp5.png

 

... And please pay attention to where you post. Questions go in the Support section not the section for completed programs.


rawr. be very afraid
*poke*
. Populate the AutoHotkey city. Pointless but somewhat fun. .


Jackie Sztuk _Blackholyman
  • Spam Officer
  • 3757 posts
  • Last active: Apr 03 2016 08:47 PM
  • Joined: 28 Feb 2012
Try this

run cmd.exe ,,Hide
Hope it helps
Helping%20you%20learn%20autohotkey.jpg?d

[AHK] Version. 1.1+ [CLOUD] DropBox ; Copy [WEBSITE] Blog ; About

niceuneasy
  • Members
  • 63 posts
  • Last active: Oct 01 2014 01:15 AM
  • Joined: 28 Apr 2013

Try this



run cmd.exe ,,Hide
Hope it helps

 

so it would look like this  f9::run cmd.exe ,,hide ipconfig/release



kon
  • Members
  • 1652 posts
  • Last active:
  • Joined: 04 Mar 2013

Try this

Run, cmd.exe, , Hide, VarPID
Sleep, 100
ControlSend, , ipconfig /release {Enter}, ahk_pid %VarPID%
Sleep, 5000
Process, Close, %VarPID%

Edit: Added the last two lines to close, otherwise the process stays open. I don't think WinClose would work because the window is hidden.



garry
  • Spam Officer
  • 3219 posts
  • Last active: Sep 20 2018 02:47 PM
  • Joined: 19 Apr 2005

instead cmd.exe or maybe command.exe , can use %comspec% /c   ( %comspec% /k )  

example run DOS hidden , write to file (desktop)  then open text-file

 

EDIT :  @Kon, good example ,  send to hidden DOS window

f9::
f1=%a_desktop%\%a_now%_ipconfig.txt
runwait,%comspec% /c ipconfig /all >"%f1%",,hide
run,%f1%
return

example,  control if sent to hidden window

/*
example to send hidden DOS Window
DATE format german = DD-MM-YY
send new date (DATE+1)  to hidden DOS
then 3 seconds later
open a new DOS window and correct DATE
*/


#singleinstance,force

F9::
DetectHiddenWindows, On
CurrentDateTime =
CurrentDateTime += 1, Days
FormatTime, New, %CurrentDateTime%, dd-MM-yy
FormatTime, Now, %a_now%, dd-MM-yy

Run,%comspec% /k, , hide, pid2
WinWait, ahk_pid %pid2%
ControlSend, ,date`n%new%`ndate/t`n, ahk_pid %pid2%

sleep,3000

run,%comspec% /k date /t`n,,,pid3
WinWaitactive, ahk_pid %pid3%
ControlSend, ,date`n%now%`n, ahk_pid %pid3%

;-- close hidden DOS window --
Process, Close, %pid2%
Process, WaitClose, %pid2%
exitapp



robertcollier4
  • Members
  • 141 posts
  • Last active: Jun 28 2019 01:05 AM
  • Joined: 11 Nov 2012

The correct answer to your question is:

F9::Run, ipconfig /release, ,Hide


garry
  • Spam Officer
  • 3219 posts
  • Last active: Sep 20 2018 02:47 PM
  • Joined: 19 Apr 2005

yes you're right

and this only if you want see what happens ( /k  keeps DOS window open )

F8::Run,%comspec% /k ipconfig /all



niceuneasy
  • Members
  • 63 posts
  • Last active: Oct 01 2014 01:15 AM
  • Joined: 28 Apr 2013

 

yes you're right

and this only if you want see what happens ( /k  keeps DOS window open )

F8::Run,%comspec% /k ipconfig /all

Thx guys this is a great help just what i needed thx too all of you  cheeers grin.png



niceuneasy
  • Members
  • 63 posts
  • Last active: Oct 01 2014 01:15 AM
  • Joined: 28 Apr 2013

Thx guys all helpful stuff! much appreciated thank you all for your help grin.png



niceuneasy
  • Members
  • 63 posts
  • Last active: Oct 01 2014 01:15 AM
  • Joined: 28 Apr 2013

Hi is there a way to combine f9::Run, ipconfig /release, ,Hide    f8::Run, ipconfig /renew, ,Hide       with just one  hotkey  f8   thank for any help



Jackie Sztuk _Blackholyman
  • Spam Officer
  • 3757 posts
  • Last active: Apr 03 2016 08:47 PM
  • Joined: 28 Feb 2012
when making multiline hotkeys you can't have anything on the same line as the hotkey

so like this maybe
f8::
Run, ipconfig /release, ,Hide
sleep 1000
Run, ipconfig /renew, ,Hide
return
Hope it helps
Helping%20you%20learn%20autohotkey.jpg?d

[AHK] Version. 1.1+ [CLOUD] DropBox ; Copy [WEBSITE] Blog ; About

niceuneasy
  • Members
  • 63 posts
  • Last active: Oct 01 2014 01:15 AM
  • Joined: 28 Apr 2013

when making multiline hotkeys you can't have anything on the same line as the hotkey

so like this maybe


f8::
Run, ipconfig /release, ,Hide
sleep 1000
Run, ipconfig /renew, ,Hide
return
Hope it helps

 

Hi blackholyman il give this a try many thx for your quick responce cheers m8