0
1

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 3 years have passed since last update.

自分用メモ

Last updated at Posted at 2020-08-25

自分用メモです。間違っていたら指摘下さい
VBAで.ps1を同期実行する方法

Sub RunBatWshShell()

    Dim obj As New IWshRuntimeLibrary.WshShell
    Dim ret As Long
    
'    ret = obj.Run("%windir%\System32\notepad.exe ""C:\web\testfile.txt""", 1, True)
'    変数=クラス設定("PowerShell指定"".ps1ファイル""",Windows構文指定,起動アプリケーションの終了確認")
     ret = obj.Run("%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe ""C:\Users\ユーザー名\myfile\babys\20200827_messagebox_powershell\messagebox.ps1""", 1, True)
    
    MsgBox "111"

End Sub

参考:https://vbabeginner.net/vba%E3%81%A7%E4%BB%96%E3%81%AE%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E5%90%8C%E6%9C%9F%E8%B5%B7%E5%8B%95%E3%81%99%E3%82%8B%EF%BC%88wshshell%EF%BC%89/

0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?