ネットワークドライブ名を変更したい為、以下の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" "" 実行時エラー:インデックスが有効範囲にありません。
↧