Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.


Go Back   Vista Forums > Misc Newsgroups > VB Script

RB

Vista - Re: Wildcard Search Modification to Script

Reply
 
08-21-2008   #1
Hal


 
 

Re: Wildcard Search Modification to Script

At this point I have not considered any other options than those mentioned.
Mainly because I like the idea of being presented with an input box over
typing the variable for %1 when running the batch file.

In the perferct world, I'd get the company I work for to higher a programmer
and have them develop a VB application that would run my query and provide an
option to open the file in Excel.

Utopia is a long way off. . . .

"Pegasus (MVP)" wrote:
Quote:

> Have you considered the option of invoking your batch
> file from within a VB Script? This would have two advantages:
> a) It would support wildcards
> b) It would run much faster than a script using WMI
>
>
> "Hal" <Hal@xxxxxx> wrote in message
> news:BD6FD129-49AD-4A32-9EA4-DE1D84161BE9@xxxxxx
Quote:

> > Hello,
> >
> > I have found the script below and it almost does what I've been looking
> > for.
> > I am in no way a programmer. I only know a minimal amount about VB and I
> > have
> > written a batch file that basically does what this script was designed to
> > do.
> >
> > I would like to have this script wrap the file name with the * wildcard.
> >
> > Thanks in advance for your understanding and paitiance.
> >
> > Hal
> ><snip>

My System SpecsSystem Spec
08-22-2008   #2
Pegasus \(MVP\)


 
 

Re: Wildcard Search Modification to Script

You can have your cake and eat it:
- Prompt the user for a folder name by using an input box.
- Pass the folder name to your own batch file.
- Pick up the output from the batch file and digest it with your script.

What does your batch file look like?


"Hal" <Hal@xxxxxx> wrote in message
news:5A711CC7-71EE-4CCC-BCAF-E7D62698C1C2@xxxxxx
Quote:

> At this point I have not considered any other options than those
> mentioned.
> Mainly because I like the idea of being presented with an input box over
> typing the variable for %1 when running the batch file.
>
> In the perferct world, I'd get the company I work for to higher a
> programmer
> and have them develop a VB application that would run my query and provide
> an
> option to open the file in Excel.
>
> Utopia is a long way off. . . .
>
> "Pegasus (MVP)" wrote:
>
Quote:

>> Have you considered the option of invoking your batch
>> file from within a VB Script? This would have two advantages:
>> a) It would support wildcards
>> b) It would run much faster than a script using WMI
>>
>>
>> "Hal" <Hal@xxxxxx> wrote in message
>> news:BD6FD129-49AD-4A32-9EA4-DE1D84161BE9@xxxxxx
Quote:

>> > Hello,
>> >
>> > I have found the script below and it almost does what I've been looking
>> > for.
>> > I am in no way a programmer. I only know a minimal amount about VB and
>> > I
>> > have
>> > written a batch file that basically does what this script was designed
>> > to
>> > do.
>> >
>> > I would like to have this script wrap the file name with the *
>> > wildcard.
>> >
>> > Thanks in advance for your understanding and paitiance.
>> >
>> > Hal
>> ><snip>

My System SpecsSystem Spec
08-22-2008   #3
Hal


 
 

Re: Wildcard Search Modification to Script

This is the contents of my batch file.

@echo off
REM ***********************
REM * Locate engine test log files
REM * Must have Mapped Drives to Test Stands
REM * Must input a unit number at time batch file is run
REM ***********************
REM * Useful Info for the file search
REM ***********************
echo Mapped Drive Reference: >> %TEMP%\TestFiles.txt
echo. >> %TEMP%\TestFiles.txt
echo I: = 91, J: = 92, N: = 93, O: = 94, U: = 95 S4k, V: = 95 S2k, W: = 96
Quote:
Quote:

>> %TEMP%\TestFiles.txt
echo If a drive letter is missing, check the mapped drive >>
%TEMP%\TestFiles.txt
echo connections via Windows Explorer >> %TEMP%\TestFiles.txt
echo _________________________________________________________ >>
%TEMP%\TestFiles.txt
echo. >> %TEMP%\TestFiles.txt
REM ***********************
REM * Search the mapped official data directorys
REM ***********************
DIR /O-D I:\data\official\%1*.* >> %TEMP%\%1.txt
DIR /O-D J:\data\official\%1*.* >> %TEMP%\%1.txt
DIR /O-D N:\data\official\%1*.* >> %TEMP%\%1.txt
DIR /O-D O:\data\official\%1*.* >> %TEMP%\%1.txt
DIR /O-D U:\data\official\%1*.* >> %TEMP%\%1.txt
DIR /O-D V:\data\official\%1*.* >> %TEMP%\%1.txt
DIR /O-D W:\data\official\%1*.* >> %TEMP%\%1.txt
REM ***********************
REM * Get the important part of the search
REM ***********************
FINDSTR "Directory %1" %TEMP%\%1.txt >>%TEMP%\TestFiles.txt
REM ***********************
REM * Display the search results
REM ***********************
notepad %TEMP%\TestFiles.txt
REM notepad %TEMP%\%1.txt
REM ***********************
REM * Do the clean up
REM ***********************
DEL %TEMP%\%1.txt
DEL %TEMP%\TestFiles.txt
@echo on


"Pegasus (MVP)" wrote:
Quote:

> You can have your cake and eat it:
> - Prompt the user for a folder name by using an input box.
> - Pass the folder name to your own batch file.
> - Pick up the output from the batch file and digest it with your script.
>
> What does your batch file look like?
>
<snip>
Quote:

>
>
>
My System SpecsSystem Spec
Reply

RB


Thread Tools


Similar Threads for: Re: Wildcard Search Modification to Script
Thread Forum
Script for OCS Policy mass modification? PowerShell
Windows Search 4 - Wildcard in file content Vista file management
PowerShell script to search text logs with many regular expressions PowerShell
Please help with folder search and copy script VB Script
unauthorized modification Vista installation & setup


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd