teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

3

上記内容で実行したところ、やはりコマンドプロンプトが開いて何も記入追加されない状況です。

2021/10/31 01:00

投稿

cerophan
cerophan

スコア15

title CHANGED
File without changes
body CHANGED
@@ -13,9 +13,15 @@
13
13
  ```VBS
14
14
  Dim objCMD
15
15
  Dim txtCmd
16
+ Dim tmp1
17
+ Dim tmp2
16
18
 
19
+ tmp1 = "test.zip"
17
- txtCmd = """C:\Program Files\7-Zip\7z.exe""" a test.zip memo.txt
20
+ tmp2 = "memo.txt memo2.txt"
18
21
 
22
+ 'txtCmd = """C:\Program Files\7-Zip\7z.exe"" a test.zip memo.txt"
23
+ txtCmd = """C:\Program Files\7-Zip\7z.exe"" a " & tmp1 & tmp2
24
+
19
25
  Set objCMD = CreateObject("WScript.Shell")
20
26
  objCMD.Run "cmd " & txtCmd
21
27
 

2

コマンドの参考元サイトを記載しました。

2021/10/31 01:00

投稿

cerophan
cerophan

スコア15

title CHANGED
File without changes
body CHANGED
@@ -8,7 +8,8 @@
8
8
  下記のようなVBSを作成しましたが、コマンドプロンプトが開いたまま何も入力されていないようです。
9
9
 
10
10
  ### 該当のソースコード
11
-
11
+ 下記のサイト内容について、vbsで実行しようとしています。
12
+ https://aprico-media.com/posts/3682
12
13
  ```VBS
13
14
  Dim objCMD
14
15
  Dim txtCmd

1

txtCmdの設定内容を追加しました。

2021/10/31 00:19

投稿

cerophan
cerophan

スコア15

title CHANGED
File without changes
body CHANGED
@@ -10,6 +10,11 @@
10
10
  ### 該当のソースコード
11
11
 
12
12
  ```VBS
13
+ Dim objCMD
14
+ Dim txtCmd
15
+
16
+ txtCmd = """C:\Program Files\7-Zip\7z.exe""" a test.zip memo.txt
17
+
13
18
  Set objCMD = CreateObject("WScript.Shell")
14
19
  objCMD.Run "cmd " & txtCmd
15
20