I think you can use FSO and InStr function.
set fso = CreateObject _ ("Scripting.FileSystemObject")
set folder = fso.GetFolder _ ("C:\someFolder\")
for each file in folder.Files
if instr (file.Name, "some value") then WScript.Echo file.Name end if
next
-- urkec
"BigBadJohn" wrote:
[Quoted Text] > Actually, I'm looking to write a VBS script to do this; I need to write a > script that locates any files that contain a specific string of characters, > then move that file to a different folder. > > "Joseph M." wrote: > > > If you're not opposed to using a batch file, it's pretty simple. > > > > dir /s *msdn* > > > > -- > > Joseph Majzoub > > Systems Engineer > > ScriptLogic Corporation > > www.scriptlogic.com > > > > > > > > "BigBadJohn" <BigBadJohn[ at ]discussions.microsoft.com> wrote in message > > news:1D0E7895-A4D1-46C8-BB4A-54FF490270D8[ at ]microsoft.com... > > > Folks, > > > > > > I am looking for a way to search a directory for files which contain a > > > specific string of characters (such as "test" or "msdn") anywhere in the > > > filename. I am trying to use this script on a Win2K Terminal machine, so I > > > cannot use the WMI 'LIKE' command. > > > > > > Help? Please? > > > > > >
|