Go Back   FlashFXP Forums > > > >

! Requests Need a script or some sort of cool .bat file ? Ask here!

Reply
 
Thread Tools Rate Thread Display Modes
Old 09-21-2005, 06:54 AM   #1
VeslaR
Junior Member
 
Join Date: Sep 2003
Posts: 20
Cool Searching directories via .bat file

Hi there,
I would need help with scripting .bat file. I wanna search the directories for some string - just like normal site search. But the thing, whish is really different is, that searching via .bat file can be much faster. I ve done some work already and it works:

@ECHO OFF
SET hledam=%1
FOR /D %%G in ("d:\somedir\*") DO dir /A:D /B "%%G" >> temp
FIND /I "%hledam%" temp
DEL temp

This batch file works quite great, if i run it from command line. (It only searches subdirectiories one level from the one in .bat dir ("somedir"). And it is fast. 15000 subdirectories in aprox. 2seconds. Thats quit good result, cause it doesnt use any index system, or pre-prepared list of directories.

But if I bind is as site command, and if I try to run to using, lets site "site search XXXX"...i got strange error:
(i switched off the "echo off" command to find the problem)

[R] 200-D:\ioFTPD\system>FIND /I "test" d:\ioFTDP\system\temp
[R] 200-FIND nenˇ n*zvem vnitýnˇho ani vnŘjçˇho pýˇkazu,
[R] 200-spustiteln‚ho programu nebo d*vkov‚ho souboru.

What means in english: FIND is not name of any built-in or addon command, runnable program neither batch file.
(sorry for my Engllish, i am sure that this msg looks completely different in English - but i guess u know what I mean :-)

Thats very strange error,because the FIND command is built-in command of all Windows.


I am using Windows 2003 server and ioFTPD 5-5-6 (i know it is very old, but it works good for me...and why should I change it, if it still works :-)

Thx for any further ideas.
VeslaR is offline   Reply With Quote
Old 09-21-2005, 07:14 AM   #2
Mouton
Posse Member
Ultimate Scripter
ioFTPD Administrator
 
Join Date: Dec 2002
Posts: 1,956
Default

I'd say it's somewhere in windows\system32. Find it and use the full path to executables in your batch files. ioFTPD environment variables are not the same as the env. vars of a command prompt.
Mouton is offline   Reply With Quote
Old 09-21-2005, 07:39 AM   #3
VeslaR
Junior Member
 
Join Date: Sep 2003
Posts: 20
Default

Ach thank u very much Mounton. It seems, that part of my problem is solved now...it doesnt return error now, but it simple does nothing ) It seems like tha stdout of find isnt good to ioFTPD...i ll try to solve it with ECHO command (which works).
VeslaR is offline   Reply With Quote
Reply

Tags
.bat, command, file, find, works

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 06:07 PM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)