Quantcast
Channel: OKWAVE 最新質問(Visual Basic/257)【本日】
Viewing all articles
Browse latest Browse all 7264

vbスクリプトの引数の記述方法

$
0
0
ネットワークドライブ名を変更したい為、以下のBATファイルとVBスクリプトを作成しました。 ですが、どうも引数が渡せていないようです。 どこが間違っているのでしょうか? どなたかご教授お願いします。 ◆BATファイル net use F: /delete net use F: \\○○\△△ set Drive = F set DriveName = PC_△△ cscript.exe "Rename.vbs" %Drive% %DriveName% ◆スクリプト(Rename.vbs) Dim oParam Dim strDrive Dim strName Set oParam = WScript.arguments strDrive = oParam(0)&":\" strName =oParam(1) With CreateObject("Shell.Application").NameSpace(strDrive) .Items().Item().Name = strName End with バッチファイルを実行すると、以下の内容になっており、引数が取得できていないようです。 cscript.exe "Rename.vbs" "" 実行時エラー:インデックスが有効範囲にありません。

Viewing all articles
Browse latest Browse all 7264

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>