본문 바로가기

Academy I/Windows

[Windows10]bat, cmd 파일 실행시 뜨는 커맨드창 안보이기

.VBS  파일 만들어 실행(.VBS 파일을 실행 함)

 
bat, cmd 파일 실행시 뜨는 커맨드창(검은 화면) 안보이기



예 1,  같은 폴더의 aa.bat  파일 실행하라는 명령어..
아래 내용을 aa.vbs 파일로 저장후 aa.vbs를 실행하면 됨

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "aa.bat" & Chr(34), 0
Set WshShell = Nothing



예 2, 경로가 있는 경우

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "C:\Program Files\aa.bat" & Chr(34), 0
Set WshShell = Nothing



출처: http://yong40.tistory.com/353 [nofile setup]