Re: I want all those MP3 files out of my file server
From: Pegasus \(MVP\) (I.can_at_fly.com)
Date: 11/10/04
- Next message: Matt Anderson: "Re: Audio Device Access in RDP Session"
- Previous message: George Hester: "Re: Reinstall IE"
- In reply to: Zorpetus: "Re: I want all those MP3 files out of my file server"
- Next in thread: Zorpetus: "Re: I want all those MP3 files out of my file server"
- Reply: Zorpetus: "Re: I want all those MP3 files out of my file server"
- Reply: Zorpetus: "Re: I want all those MP3 files out of my file server"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 11 Nov 2004 07:31:33 +1100
"Zorpetus" <zorpetus@yahoo.com> wrote in message
news:c51808d3.0411101128.7e7691df@posting.google.com...
> > The script sample I gave you creates one text file for every user's
> > personal share. Isn't this what you require?
>
> Yes! :)
>
> Thank you very much!
> I just have to figure out how to:
>
> a) extend this batch process to some other folder trees (just to add
> one
> more line with that alternate path?)
>
> b) how to run it without anybody logged on (with the help of Command
> Scheduler I guess - but it seems that it needs CMD.EXE as well?).
>
> Thank you very much in advance one more time!!!!
The Task Scheduler is ideally suited for this type of job. There is no need
to invoke an additional Command Processor - just invoke the batch file
itself.
Below is a modified version that lets you deal with any share, whether
personal or otherwise. You simply have to define it in a text file like so:
JSmith$ JSmith PBrown
Finance AWhite PBrown
HR TDean AClinton
The first column is the share name.
The second column is the owner's EMail prefix.
The third column is his supervisor's EMail prefix.
The modified version creates one text file in c:\Logs\Messages for
each share that you deal with. The lines are numbered so that you
can unwrap them properly before removing the numbers. This
version is only partly tested.
1 @echo off
2 set Limit=10000000
3 set Domainl=somecompany.com
4 set MsgFolder=c:\Logs\Messages
5 if not exist %MsgFolder% md %MsgFolder%
6 rem The file c:\Tools\Users.lst contains a list of all users to be
monitored.
7 rem It must be in this format:
8 rem ShareName Owner Supervisor
9 rem e.g. TWhite$ TWhite ABrown
10 rem The first word is the name of the share.
11 rem The second word is the user's EMail prefix.
12 rem The third word is his administrator's EMail prefix
13 for /F "tokens=1-3" %%a in (c:\Tools\Users.lst) do call :CheckSpace %%a
%%b %%c
14 goto :eof
=================================
15 :CheckSpace
16 set total=0
17 set files=0
18 set share=%1
19 set user=%2
20 set supervisor=%3
21 rem The following lines assume that the share is in \\YourServer\JSmith$
(for example)
22 for /F "tokens=1-4" %%a in ('dir /s /-c "\\YourServer\%share%\*.mp3 ^|
find /i "File(s)"') do set files1=%%a & set size1=%%c
23 for /F "tokens=1-4" %%a in ('dir /s /-c "\\YourServer\%share\*.avi ^|
find /i "File(s)"') do set files2=%%a & set size2=%%c
24 for /F "tokens=1-4" %%a in ('dir /s /-c "\\YourServer\%share%\*.wav ^|
find /i "File(s)"') do set files3=%%a & set size3=%%c
25 set /a total=%size1% + %size2% + %size3%
26 set /a files=%files1% + %files2% + %files3%
27 if %total% LSS %Limit% goto :eof
28 echo Note to %user% > %MsgFolder\%Share%
29 echo Copy to %supervisor% >> %MsgFolder%\%Share%
30 echo. >> %MsgFolder%\%Share%
31 echo Server Disk Space Usage >> %MsgFolder%\%Share%
32 echo ====================== >> %MsgFolder%\%Share%
33 echo. >> %MsgFolder%\%Share%
34 echo This is an automatic message from the disk space monitor.>>
%MsgFolder%\%Share%
35 echo. >> %MsgFolder%\%Share%
36 echo You currently store %files% music files on the share "%share%" on
the server.
37 echo These files consume %total% bytes of disk space. >>
%MsgFolder%\%Share%
38 echo. >> %MsgFolder%\%Share%
39 echo Your own words here . . . >> %MsgFolder%\%Share%
40 echo c:\tools\blat . . . %user%@%Domain% . . . %supervisor%@%Domain% . .
. %%MsgFolder%\%Share%
- Next message: Matt Anderson: "Re: Audio Device Access in RDP Session"
- Previous message: George Hester: "Re: Reinstall IE"
- In reply to: Zorpetus: "Re: I want all those MP3 files out of my file server"
- Next in thread: Zorpetus: "Re: I want all those MP3 files out of my file server"
- Reply: Zorpetus: "Re: I want all those MP3 files out of my file server"
- Reply: Zorpetus: "Re: I want all those MP3 files out of my file server"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|