Hi All,
Is there anyway of monitoring disk activity in a particular folder? Basically, I have a folder and I want to be able to record the file name of every file that is written to this folder or modified within the folder, in real time.
Can this be done in VB?
TIA :)
Aha! Thanks GMMastros, I have only just started using the FSO, so had no idea you could do that! :)
But PCLewis - I am now REALLY confused as to what Dir$() is doing! If I replace the incorrect file name with some other random text (ie - blahblah.mp3) it works correctly even tho its basically...
OK... so I got it working by comparing the Dir$() result to the original text line (if its valid it will return the file name without the full path, so its different to the line of text but if it is a non existant file it returns the string again so the comparison is true and jumps to the else...
lol, yes I suppose that would be useful...Here it is:
Dim Trackname As String
Dim fso, TextStream As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Set TextStream = fso.OpenTextFile("c:\nowplaying.m3u")
Trackname = TextStream.readline
If Dir$(Trackname) <> ""...
Hi All,
Am trying to check if a file exists using Dir$(filenamehere) and this works fine when I pass a filename to it by typign it in manually or even via a variable. However, if I read the filename from a text file using Textstream.Readline, it ALWAYS says the file exists, even when it...
Hi All,
I am writing a very simple app that will shut my laptop down when the power is unplugged. I am using the Sysinfo Active X control v6 to monitor the status every 10 secs via a timer, but I want the laptop to enter Hibernate instead of shutdown (shell"shutdown -s") but can't seem to find...
bjd4jc - thats exactly the sort of thing I want to avoid! :) - in this instance, curfile is created by the app, but as it just pulls up a filename, that file name could contain all sorts of nasties!
Hi All,
I am trying to write some info to an Access Db, it all works fine until the data it's adding contains a ' (single apostrophe!). It then bombs out because now the command line is fragmented.
I know in perl (and other languages I believe) you can use place holders to get around this...
Thankyou Bjd4Jc! you have solved it... I am going to stand in the corner with the dunce hat on! :$
The URL field was too short in the DB, I had assumed Access would allow it to be 255 (as that's the maximum), but completely forgot I had to actually define that value myself! doh!
Thanks again! :)
Hi all,
I am a n00bi3 VB6 programmer and have written (and/or borrowed!) the following code, it runs fine for the first 12 records it writes to the DB, but after that I get an error saying:
Run-Time error '-2147217887 (80040e21)':
Multiple-step operation genreated errors. Check each status...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.