−−−−−−−−−−−−−−−−−−−−−−−−−−−− Set regEx = New RegExp regEx.IgnoreCase = True regEx.Global = True regEx.Pattern = "\nLast-Modified\: .{3}, (\d{1,}) (.{3}) (\d{4}) (\d{1,})\:(\d{1,})\:(\d{1,}) .{3}\r\n" ' lastmod = regEx.Replace(xh.getAllResponseHeaders(),"$1/$2/$3/$4/$5/$6") Set Matches = regEx.Execute(xh.getAllResponseHeaders())
For Each Match in Matches out = regEx.Replace(Match,"$1/$2/$3/$4/$5/$6\r\n") If out = Match Then Else lastmod = Match End If Next −−−−−−−−−−−−−−−−−−−−−−−−−−−−
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 −−−−−−−−−−−−−−−−−−−−−−−−−−−−