本帖最后由 wzehu 于 2025-5-10 13:34 编辑
XP右键"新建带模版的批处理"-VBS 版
Set objShell = CreateObject("WScript.Shell")
objShell.Run "cmd /c color 86", 0, True
objShell.Run "cmd /c mode con cols=16 lines=1", 0, True
n = 0
Do
filePath = Left(WScript.Arguments(0), InStrRev(WScript.Arguments(0), "\")) & "NewBAT" & n & ".bat"
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(filePath) Then
n = n + 1
Else
Exit Do
End If
Loop
sourcePath = objShell.ExpandEnvironmentStrings("%windir%") & "\Newbat\New.bat"
Set inFile = fso.OpenTextFile(sourcePath, 1)
Set outFile = fso.CreateTextFile(filePath, True)
outFile.Write(inFile.ReadAll)
objShell.Run "notepad.exe " & filePath, 1, False
WScript.Sleep 200
If fso.FileExists(filePath) Then
fso.DeleteFile filePath
End If
WScript.Quit |