Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » Need Help on Writing a script for a scheduled task on XP
Closed Thread
Old 03-23-2006, 05:11 PM   #1 (permalink)
 
Newb Techie

Join Date: Jan 2006

Posts: 39

smartydebater

Default Need Help on Writing a script for a scheduled task on XP

HI, I need help writing a script. I need the script to do a search the c:/ drive for limewire. Then I would like the results of the search saved to a log file. I'd be using this script as a task in XP. I don't care what it's written in, as long as it doesn't take up too much memory and it will be easy to setup in XP.

Thanks
smartydebater is offline  
Old 03-23-2006, 06:45 PM   #2 (permalink)
 
Newb Techie

Join Date: Aug 2005

Posts: 22

Cache

Default Re: Need Help on Writing a script for a scheduled task on XP

Quote:
Originally posted by smartydebater
do a search the c:/ drive for limewire.
This doesn't really mean anything. Be more specific and the answers you get may be more helpful.
Cache is offline  
Old 03-24-2006, 03:36 PM   #3 (permalink)
 
Newb Techie

Join Date: Jan 2006

Posts: 39

smartydebater

Default

Okay, basically I want a script that will do a search on C:// for "limewire". Then I would like the results of the search saved to a log file.

Is that doable?
smartydebater is offline  
Old 03-27-2006, 11:44 AM   #4 (permalink)
 
Monster Techie

Join Date: May 2004

Location: /usr/root/mn/us

Posts: 1,121

bla!! is on a distinguished road

Default

Yup, just make a batch file and copy this code into it.

Code:
@echo off
dir \ /s | find "limewire" > c:\log.txt
change the c:\log.txt to the path of where you want the log file placed.

The only downside is that a msdos window will pop up while this command is completing. On my box it takes between 3 and 4 seconds to complete.
__________________
<br>
Its a frigging Laptop, not a Labtop!!!!
bla!! is offline  
Old 03-28-2006, 12:55 AM   #5 (permalink)
office politics's Avatar
 
It's all just 1s and 0s

Join Date: Jan 2004

Location: in the lab

Posts: 4,410

office politics will become famous soon enough

Default

Quote:
Originally posted by bla!!
The only downside is that a msdos window will pop up while this command is completing. On my box it takes between 3 and 4 seconds to complete.
you could suppress the gui by running a vbs script using the wshshell.run command and using 0 for the windowtype argument

http://www.devguru.com/technologies/wsh/17419.asp

Set WshShell = WScript.CreateObject("WScript.Shell")
intReturn = WshShell.Run("start batch.bat", 0, TRUE)
office politics is offline  
Old 03-28-2006, 10:06 PM   #6 (permalink)
 
Monster Techie

Join Date: May 2004

Location: /usr/root/mn/us

Posts: 1,121

bla!! is on a distinguished road

Default

Cool, I'll definitely use that tip csamuels.

Just for a follow up, we used this for the final code:
Code:
@echo off
dir \ /s | find "limewire" >> "c:\documents and settings\username\desktop\log.txt
We replaced > with >> so it would append to the log rather than overwrite it.
__________________
<br>
Its a frigging Laptop, not a Labtop!!!!
bla!! is offline  
 
Closed Thread

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On