Page 1 of 1 1
Topic Options
#204155 - 2012-01-30 11:04 PM Weekly Clean up script HELP!!!!
Alucard_Kakashi Offline
Fresh Scripter

Registered: 2009-02-05
Posts: 37
Loc: USA
I am trying to create kix script that will delete all nonsense files from a desktop on a particular user account. it must be done weekly. i have somewhat the logic of it but can't put it into coding yet.

if user == guest && @date == Friday
del %userprofile%/desktop/*.mp3.

can anyone help me out. having trouble with this. Thanks in advance.

Top
#204156 - 2012-01-30 11:58 PM Re: Weekly Clean up script HELP!!!! [Re: Alucard_Kakashi]
Alucard_Kakashi Offline
Fresh Scripter

Registered: 2009-02-05
Posts: 37
Loc: USA
Does this make sense?

IF @user == "guest" && @date == "Friday"
delete %userprofile%\Desktop\*.mp3
END IF

and can I add a computer name to it?

Top
#204157 - 2012-01-31 12:23 AM Re: Weekly Clean up script HELP!!!! [Re: Alucard_Kakashi]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4563
Loc: USA
The code you listed looks something like batch to me... this is a kixtart forum.

Untested kix code below, use at your own risk
 Code:
If @user="guest" and @day="Friday" and @wksta="SomePCName"
  del "%userprofile%\Desktop\*.mp3"
endif

Top
#204189 - 2012-02-02 06:54 PM Re: Weekly Clean up script HELP!!!! [Re: Allen]
Alucard_Kakashi Offline
Fresh Scripter

Registered: 2009-02-05
Posts: 37
Loc: USA
thanks i got it to work. with this:

$CLEANUP = @SCRIPTDIR + "\DesktopCleanup.bat"

BannerWarning("Deleting Items from GUEST Desktop")

IF @USERID = "GUEST" and @DAY = "Friday"
RUN $CLEANUP
ENDIF

Top
#204190 - 2012-02-02 07:54 PM Re: Weekly Clean up script HELP!!!! [Re: Alucard_Kakashi]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4563
Loc: USA
What is in the BAT that couldn't be done all in the kix script?
Top
#204191 - 2012-02-02 07:59 PM Re: Weekly Clean up script HELP!!!! [Re: Allen]
Alucard_Kakashi Offline
Fresh Scripter

Registered: 2009-02-05
Posts: 37
Loc: USA
so use to doing this in bat mode, but this is what i have:

Set source=%USERPROFILE%\Desktop

ECHO ON

del /s "%source%\*.mp3"
del /s "%source%\*.docx"
del /s "%source%\*.doc"
del /s "%source%\*.xlsx"
del /s "%source%\*.xls"
del /s "%source%\*.pptx"
del /s "%source%\*.ppt"
del /s "%source%\*.jpg"
del /s "%source%\*.jpeg"
del /s "%source%\*.png"
del /s "%source%\*.gif"
del /s "%source%\*.avi"
del /s "%source%\*.wma"
del /s "%source%\*.mpeg"
del /s "%source%\*.bmp"

Top
#204192 - 2012-02-02 08:43 PM Re: Weekly Clean up script HELP!!!! [Re: Alucard_Kakashi]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4563
Loc: USA
This is a start with your extensions using the UDF Dirplus. Dirplus also supports subdirectories too, so you could modify this to delete folders if necessary.

 Code:
for each $file in dirplus("%userprofile%\desktop","/f mp3 docx doc xlsx xls pptx")
  ? $file
  ;del $file
next


Dirplus() - http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=82153

How to use UDFs -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81943#Post81943

The rest of the UDFs are here -
http://www.kixtart.org/forums/ubbthreads.php?ubb=postlist&Board=7&page=1

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 394 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.063 seconds in which 0.031 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org