Skip to main content
gamedev.net
🔒 Locked

run scripts

Started by Gaiiden 8 replies 1.7k views
Original Post
Gaiiden
Gaiiden
I just had an idea but I don't know how or if I can implement it. I use POPFile to filter out spam email but it takes up 15MB of my system memory. I know I know - but 15MB is 15MB after all :P Sooo I was wondering if there was a way I could set something up in XP that would run POPFile when Outlook is run, and then unload POPFile when Outlook is closed - cause the only time I need it is when Outlook is running. Anyone know how I would do this? Can I do this? Cause that would rock... I suppose I could mention this to the developer if nothing else. Seems like something the thing should do anyways.
Drew Sikora
Executive Producer
GameDev.net
Nemesis2k2
Nemesis2k2
You could write a batch script, like the following:

start %programfiles%\folder\popfile.exe%programfiles%\folder\outlook.exetaskkill /IM popfile.exe


Enter proper paths to each executable (leave in the %programfiles% variable, just enter the path relative to that), save it as text and change the extention to .cmd, and run it instead of your outlook shortcut. With this method, the console window will stay visible while outlook is open however. To get around this, download cmdow, stick it in your system32 directory, and add this line to the start of your script:

cmdow @ /hid
aidan_walsh
aidan_walsh
What about an Outlook Plugin?

Outclass

Quote:
Outclass provides POPFile's functionality natively to Outlook. What does this mean? It means that you can use the power of POPFile to classify any email you receive using Microsoft Outlook. This includes IMAP-based email and Exchange-based email as well as any other types that may be supported via Office add-ins (theoretically, anyway).

Outclass has been tested with Outlook 2000, Outlook 2002 (XP), and Outlook 2003, using Exchange, POP3, and IMAP mail, on Windows 2000 and Windows XP and with POPFile v0.18.0 through v0.19.1.


Though the latest version of Outclass boasts support for POPFile 0.21.x.
www.aidanwalsh(.net)(.info)
Nemesis2k2
Nemesis2k2
AFAIK, Outlook Express doesn't support plugins. It depends if he's using Outlook Express or the full Outlook.
Gaiiden
Gaiiden
@Nemesis2k2:

Okay here's what my batch command looks like:
start C:\progra~1\POPFile\runpopfile.exeC:\progra~1\Micros~2\office11\outlook.exetaskkill /IM popfileb.exe

Yea for some reason I got an error saying windows couldn't find "C:\Program" so I racked my brain and remembered the old 8-char file system scheme and used that. Now it works as far as loading the two apps, but nothing happens to popfileb.exe when I close Outlook, although the cmd window is staying open (I left out the close script to see if the cmd window would give me any hints).

Any ideas? And thanks for the help, ratings++!
Drew Sikora
Executive Producer
GameDev.net
b2b3
b2b3
I think you need to use start for outlook too. IIRC, by default command-line does not wait for windowed application to end. Try this:

start C:\progra~1\POPFile\runpopfile.exestart -WAIT C:\progra~1\Micros~2\office11\outlook.exetaskkill /IM popfileb.exe


And you can also use long file names, just write them with quotes, eg:
start -WAIT "c:\program files\microsoft office\office11\outlook.exe"
Nemesis2k2
Nemesis2k2
Sorry, when you have spaces in the path name, surround the path with quotes, like so:

start "C:\Program files\POPFile\runpopfile.exe"

It's good practice to always use quotes on path names to avoid problems, and keep it uniform. Also, I'd suggest you use the %programfiles% environment variable, like so:

start "%programfiles%\POPFile\runpopfile.exe""%programfiles%\Microsoft Office\office11\outlook.exe"taskkill /IM popfileb.exe

Quote:
Now it works as far as loading the two apps, but nothing happens to popfileb.exe when I close Outlook, although the cmd window is staying open (I left out the close script to see if the cmd window would give me any hints).

What is it pausing on? The only reason I can see why this script would remain open is if outlook isn't really closed, and it's pausing on the second line waiting for it. Check the task manager and see if the process remains running after you think you've closed it. Once outlook closes, you should see it execute the taskkill line. I assume it isn't doing that.
Nemesis2k2
Nemesis2k2
Quote:
I think you need to use start for outlook too. IIRC, by default command-line does not wait for windowed application to end.

When you type it into the command console, no, but when you execute a program from a batch script, it waits for it to terminate before continuing.
Gaiiden
Gaiiden
new batch file:
cmdow @ /hidstart C:\progra~1\POPFile\runpopfile.exe /startupstart C:\progra~1\plaxo\2.6.2.9\plaxohelper.exe -aC:\progra~1\Micros~2\office11\outlook.exetaskkill /IM plaxohelper.exestart C:\progra~1\POPFile\stop_pf.exe /showerrors 8080

I solved my previous problem since POPFile has this handy .exe to shut itself down so i just used another start command, but then I found this other process I can kill when I'm not using outlook and the taskkill command still won't work on it. One up one down :P

[edit]
n/m! I got it! Googled taskkill and tried using the /f parameter to force the kill and it worked. all good now thanks guys
Drew Sikora
Executive Producer
GameDev.net
Nemesis2k2
Nemesis2k2
Yeah, I should've mentioned /F earlier. It's sometimes required. Glad to hear you got it working.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.