Set Fs = WScript.CreateObject("Scripting.FileSystemObject") Set Shell = WScript.CreateObject("Shell.Application")
For Each sArg In WScript.Arguments If Fs.FileExists(sArg) Or Fs.FolderExists(sArg) Then Call ModifyDate(sArg,Date) End If Next
MsgBox "終了"
Sub ModifyDate(path,dateval) Shell.NameSpace(Fs.GetParentFolderName(path)).ParseName(Fs.GetFileName(path)).ModifyDate=dateval End Sub −−−−−−−−−−−−−−−−−−−−−−−−−−−−−
vectorで「touchme.vbs」をDLしてreadmeを見てみたら −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− (1) Windows "Shell.Application" FolderItem.ModifyDateが変更できるのは、Windows 2000/XPだけのようです。 Windows 98/MEでは、変更できないようです。 −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
−−−−−−−−−−−−−−−−−−−−−−−−−−−− testDate = "01 Jan 1998 00:00:00" 'testDate1 = cDate(testDate) If isDate(testDate) Then wscript.echo "日付認識" Else wscript.echo "日付ではない" End If wscript.quit −−−−−−−−−−−−−−−−−−−−−−−−−−−−