telemorgan
MIS
I have been trying to write a script that will run this command for each file created after a certain date:
For example: (In logical terms)
MONTH=(xx)
DAY=(xx)
YEAR=(xxxx)
For each <filename> in y:\<dir1>\<dir2> with the extension .mdf newer then xx/xx/xxxx do;
y:\<dir1>\<action>.exe <filename>
If I knew how to call that .exe against each file, I think this would work but It's still missing two important things:
1) It doesn't specify the y:\<dir1>\<dir2> directory to gather the file names
2) It doesn't just run against .mdf files
**********************************************************
strMonth = InputBox ("Enter a 2 digit month")
strDay = InputBox ("Enter a 2 digit day")
strYear = InputBox ("Enter a 4 digit year")
strDate = strYear & strMonth & strDay & "000000.000000+000"
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery _
("Select * From CIM_DataFile Where CreationDate >= '" & strDate & "'")
For Each objFile In colFiles
Do action
Next
***********************************************************
Please Help!!
For example: (In logical terms)
MONTH=(xx)
DAY=(xx)
YEAR=(xxxx)
For each <filename> in y:\<dir1>\<dir2> with the extension .mdf newer then xx/xx/xxxx do;
y:\<dir1>\<action>.exe <filename>
If I knew how to call that .exe against each file, I think this would work but It's still missing two important things:
1) It doesn't specify the y:\<dir1>\<dir2> directory to gather the file names
2) It doesn't just run against .mdf files
**********************************************************
strMonth = InputBox ("Enter a 2 digit month")
strDay = InputBox ("Enter a 2 digit day")
strYear = InputBox ("Enter a 4 digit year")
strDate = strYear & strMonth & strDay & "000000.000000+000"
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService.ExecQuery _
("Select * From CIM_DataFile Where CreationDate >= '" & strDate & "'")
For Each objFile In colFiles
Do action
Next
***********************************************************
Please Help!!