Option Explicit dim text:text ="400件/750件" call outputprogress(text) sub outputProgress(text) call deletePrgrsFile call makePrgrsFile(text) end sub '------------------------------ ' メイン処理 '------------------------------ Sub makePrgrsFile(text) dim myPath : myPath = Wscript.scriptFullname dim yPos : yPos = instrrev(myPath , "\") dim strFile: strFile = left(myPath,yPos) & "VBS進行率:" & text & ".prgrs" dim objFS: Set objFS = CreateObject("Scripting.FileSystemObject") dim obfFile : Set obfFile = objFS.CreateTextFile(strFile) ' ファイル作成 set objFS = nothing set obfFile = nothing end sub sub deletePrgrsFile() on error resume next dim myPath : myPath = Wscript.scriptFullname dim yPos : yPos = instrrev(myPath , "\") dim tarFile:tarFile = left(myPath,yPos) & "*.prgrs" with CreateObject("Scripting.FileSystemObject") .DeleteFile tarFile end with end sub