8
3

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.

作業ディレクトリを指定してプログラムを実行

Posted at

exeをおいているディレクトリにてexeを実行することを想定されているプログラムの場合、
カレントディレクトリを指定しないと正しく実行できない事があります。

workingdir.vbs
Option Explicit
Dim wShell
Set wShell = CreateObject("WScript.Shell")
wShell.CurrentDirectory = "c:\Program Files\sample"
' 実行プログラムの指定はダブルクォーテーションでくくること。
wShell.Run """c:\Program Files\sample\program.exe""",1,TRUE
8
3
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
8
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?