Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 11th, 2005, 01:44 AM
zr11 zr11 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 1 zr11 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 32 sec
Reputation Power: 0
Question WSH .vbs Script which will Kill a process when a file is created.

I want to have a script that starts a program that creates files, have the script know when the file has been created, then terminate the program and do some post processing with the created file. I have already scripted the post processing scripting and it works well. I can also get the program that creates the file to start and do the file creation. The problem is finding a way to make the script wait till the file was done being created to do the post processing scripting. Using sleep/wait statements is not an option as the time it takes to create the file will vary with different sizes of files. I have come up with the idea of having the PROGRAM create 2 files. The first would be the file that I actually want to do the post processing on (The GOOD FILE) the second would just be a dummy file that would act as an alerter that the file to be post processed was ready! Is it possible to get a .vbs script to watch for the appearance in a certain location/directory of a file with a specific name.... To further complicate this endeavor the script will be fired multiple times and I do not want multiple instances of the PROGRAM that creates the file operating at the same time, so I would like when the script that fires the PROGRAM starts that it check to see if the PROGRAM was already running, and if so wait till it was killed before starting the process all over again.

I have placed a bit of a flow below of what I am looking for.

1. Script is started via call from ASP script (ALREADY DONE)

2. Script checks to see if the PROGRAM is running (NOT DONE)

3. If PROGRAM is NOT running then it is started and script waits for FILE2 to appear in a directory. If running then wait till it is killed then start PROGRAM. (NOT DONE)

4. PROGRAM creates FILE 1 - Real File (ALREADY DONE)

5. PROGRAM creates FILE 2 - Dummy File script was waiting for to move on(ALREADY DONE)

6. Script kills PROGRAM (NOT DONE)

7. Script performs post processing on FILE 1 (ALREADY DONE)

8. Script Deletes FILE 2 and moves FILE 1 to another directory(ALREADY DONE)

I can do allot of the scripting myself I just need help with the more advanced stuff. Also these directories are networked folders. That can be changed though if needed. I do not know what .vbs files have access to do.

Thanks,
zr11

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > WSH .vbs Script which will Kill a process when a file is created.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT