vbs脚本 给指定文件改名为当前日期
1个回答
展开全部
Dim objFSO
Dim objFile
Dim strFileOrg
Dim strFileNew
Dim dtmNowDate
strFile = "C:\1.txt"
dtmNowDate = Now()
dtmNowDate = Year(dtmNowDate) & Month(dtmNowDate) & Day(dtmNowDate)
strFileNew = "C:\" & dtmNowDate & ".txt"
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(strFile)
objFile.Move(strFileNew)
Dim objFile
Dim strFileOrg
Dim strFileNew
Dim dtmNowDate
strFile = "C:\1.txt"
dtmNowDate = Now()
dtmNowDate = Year(dtmNowDate) & Month(dtmNowDate) & Day(dtmNowDate)
strFileNew = "C:\" & dtmNowDate & ".txt"
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(strFile)
objFile.Move(strFileNew)
追问
执行到
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
出错
追答
我在自己机器上运行都没问题才贴上来的
你确定没黏贴错误吗?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询