1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

dos画面を最前面にしないでバッチ処理実行

Last updated at Posted at 2016-10-25

dos画面を最前面にしないでバッチ処理実行

MSSQLSERVER-start.vbs
Option Explicit

Const vbHide = 0             'ウィンドウを非表示
Const vbNormalFocus = 1      '通常のウィンドウ、かつ最前面のウィンドウ
Const vbMinimizedFocus = 2   '最小化、かつ最前面のウィンドウ
Const vbMaximizedFocus = 3   '最大化、かつ最前面のウィンドウ
Const vbNormalNoFocus = 4    '通常のウィンドウ、ただし、最前面にはならない
Const vbMinimizedNoFocus = 6 '最小化、ただし、最前面にはならない

Dim objFso
Dim currentFolder
Dim objWShell

Set objFso = createObject("Scripting.FileSystemObject")
'自分自身のパスを取得
currentFolder = objFso.GetFile(WScript.ScriptFullName).ParentFolder.Path

Set objWShell = CreateObject("WScript.Shell")
'自分自身のパスをカレントにする
objWShell.CurrentDirectory = currentFolder
objWShell.Run "MSSQLSERVER-start.cmd", vbMinimizedNoFocus, False

Set objWShell = Nothing

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?