Posted: 12/12/2004 4:12:21 PM EDT
|
Ok i'm a VB dummy but heres what im trying to do: I need a vbscript to run as a service that will scan a certain folder for any files in it if a file appears in it (that will be copied to it over the network) it will move the file to a different folder then open the file using its default application. I google'd for vb code with no luck. Any help plz? |
It's not that hard but I'll have to dig through my fading memory to try and remember what I did back in 2001 I wrote a little service when I worked at Verizon that would hit the database every 5 minutes , bring back the result set, wrap it all up in a XML file and copy it out to a location on the app server. I haven't used VB in 3 years so you'll have to bear with me. We could do it in Java if you want! |
|
Nevermind ... did something up in a 3rd party automation app called WinTask Pro Dim tab1$(100) Dim tab2$(100) Dim tab3$(100) top: ChDir("h:\1torrents") spec$="*.torrent" nb=dir(spec$,tab1$(),tab2$(),tab3$(),"R") rem msgbox(nb$) IF nb > 0 THEN FileCopy(tab1$(0), "1.torrent") Name(tab1$(0), "h:\2torrents") Shell(chr$(34)+"1.torrent"+chr$(34), 1) pause 30 Kill("1.torrent") ENDIF pause 60 goto top |
The reason for this was because my downloading of pr0n via bittorrent was really lagging the wireless connection on my laptop. I'm now running the above automation script on my headless server (directly attached at 100mbit) that automatically starts downloading stuff itself when initiated by me, sitting at my lappy, in the next room.
|
Funny, I'm writing a java program that does exactly that for a friend's work... it uses http://wrapper.sf.net to run as a native nt service.. (as best java can with NT) ETA: not the open the file part, just scan and move part. |
I wrote a little service when I worked at Verizon that would hit the database every 5 minutes , bring back the result set, wrap it all up in a XML file and copy it out to a location on the app server. I haven't used VB in 3 years so you'll have to bear with me. We could do it in Java if you want!