Page 1 of 2 12>
Topic Options
#49278 - 2000-03-27 08:56 AM del *.tmp in C:\windows\temp
Anonymous
Unregistered


How do i delete al items in C:\windows\temp without the message yes or no at logon.


nboersen@vug.nl

Top
#49279 - 2000-03-27 09:29 AM Re: del *.tmp in C:\windows\temp
Anonymous
Unregistered


Hi

I would guess at using SENDKEYS.

------------------
Don Davidson
Network Engineer
http://www.insight-media.co.uk


Top
#49280 - 2000-03-27 09:58 AM Re: del *.tmp in C:\windows\temp
Anonymous
Unregistered


Don,
Show me in a script, so i can try if it works.

Top
#49281 - 2000-03-27 10:13 AM Re: del *.tmp in C:\windows\temp
Anonymous
Unregistered


Hi

Had another brainwave!

Try

CD "c:\windows\temp"
DEL "*.*"

The manual says DEL does not prompt for user intervention.

I was thinking of SENDKEYS for use with a batch file!

------------------
Don Davidson
Network Engineer
http://www.insight-media.co.uk


Top
#49282 - 2000-03-27 10:20 AM Re: del *.tmp in C:\windows\temp
Anonymous
Unregistered


Hi,
i have tryd this, but it is not working correctley, i is not working at all togetter with a .scr script.

Top
#49283 - 2000-03-27 10:25 AM Re: del *.tmp in C:\windows\temp
Anonymous
Unregistered


Hi

Weird it works for me!

Ok what clients? NT4 or Win9x ?

I also ran the two lines in debug mode and then checked c:\windows\temp and files had gone!

Post the code you are working with and any other relevant info.

------------------
Don Davidson
Network Engineer
http://www.insight-media.co.uk


Top
#49284 - 2000-03-28 01:36 AM Re: del *.tmp in C:\windows\temp
Anonymous
Unregistered


Hi, I'm a bit new but I hope you don't mind me butting in. We use the following in hte autoexec.bat:

Del C:\windows\temp\*.tmp

but if you wanted to use it in a login script, Del C:\windows\temp\*.tmp /y should do it.

HTH

Craig

Top
#49285 - 2000-03-28 03:13 AM Re: del *.tmp in C:\windows\temp
Anonymous
Unregistered


Don,
I use NT & Win9x

But nothing works in comination with kix32.

nick


Top
#49286 - 2000-03-28 03:15 AM Re: del *.tmp in C:\windows\temp
Anonymous
Unregistered


Craig,
this will not work, I try'd but all the files and directory's still stay on ther places and will not be removed while using kix32.

Top
#49287 - 2000-03-28 03:53 AM Re: del *.tmp in C:\windows\temp
Anonymous
Unregistered


Did you try this?

SHELL "%COMSPEC% /C del c:\windows\temp\*.*"

Top
#49288 - 2000-03-28 04:01 AM Re: del *.tmp in C:\windows\temp
Anonymous
Unregistered


Bonk,
This will work a little bit, but i wil still have to say Y, on when ther was askt "are you shure you want to delete al these files?
and thad is wat i dont want to see on my screen.
even with /y he is telling me that it is a wrong option /y.

nick

Top
#49289 - 2000-03-28 04:37 AM Re: del *.tmp in C:\windows\temp
Anonymous
Unregistered


Hi

A guess here as I have not used this function before!

SENDKEYS "Y {ENTER}"

Hope this helps.

------------------
Don Davidson
Network Engineer
http://www.insight-media.co.uk


Top
#49290 - 2000-03-28 04:51 AM Re: del *.tmp in C:\windows\temp
Anonymous
Unregistered


Don,
No this is not working,
Script error : unknown command !. SENDKEYS "y {enter}".
and still the machine asks the same question. yes or no.

nick

Top
#49291 - 2000-03-28 05:03 AM Re: del *.tmp in C:\windows\temp
Anonymous
Unregistered


Hi

Silly me READ THE ***** MANUAL!

SENDKEYS ("Y {ENTER}")

Try again

------------------
Don Davidson
Network Engineer
http://www.insight-media.co.uk


Top
#49292 - 2000-03-28 06:02 AM Re: del *.tmp in C:\windows\temp
Anonymous
Unregistered


Sorry but the sam question is comming back.
Are you sure you want to remove all files Y/N?

script error : unknown command !.
SENDKEYS ("y {enter}")

Top
#49293 - 2000-03-28 10:12 AM Re: del *.tmp in C:\windows\temp
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
ok i couldn't stay from this one

here is some code that will remove all files and directories in the %temp% directory.

you can also download the file here
http://www.neosoft.com/~brycel/kix/other_scripts/del_temp/del_temp.kix

code:

break on cls

$tempdir = "temp1.dat"
$tempfile = "temp2.dat"
dim $tempdir_data[99999]

:wrong
? "This will Delete all files and Directories in"
? "%temp%!!! are you sure?(y/n)"
get $yn
select
case lcase($yn) = "y"
;run rest of code
case lcase($yn) = "n"
exit
case 1
goto wrong
endselect


shell "%comspec% /c dir %temp% /ad /b /s > $tempdir"
shell "%comspec% /c dir %temp% /a-d /b /s > $tempfile"

? "Deleting the files in %temp%" gosub kill_files
? "Removing all Directories in %temp%" gosub Kill_directories

del $tempdir
del $tempfile
exit


;----------------------------
:Kill_Files
;----------------------------

$q = open(1,$tempfile)
$tempfile_data = readline(1)
while @error = 0
del $tempfile_data
$tempfile_data = readline(1)
loop
$q = close(1)
return

;----------------------------
:Kill_directories
;----------------------------
$array_count = 0
$q = open (1,$tempdir)
$tempdir_data[$array_count] = readline(1)

while $tempdir_data[$array_count] <> ""
$array_count = $array_count + 1
$tempdir_data[$array_count] = readline(1)
loop
$q = close(1)

rd $tempdir_data[$array_count]
while $array_count >= 0
rd $tempdir_data[$array_count]
$array_count = $array_count - 1
loop
return



Top
#49294 - 2000-03-28 09:35 PM Re: del *.tmp in C:\windows\temp
Anonymous
Unregistered


why dont you use the deltree command in DOS then call the kix script from within DOS to execute the remaing code.


Top
#49295 - 2000-03-29 08:41 AM Re: del *.tmp in C:\windows\temp
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
I wanted a piece of code that would work on both NT and 9x computers. The DEL, DELTREE and RD commands are different between these these two platforms(NT doesn't even have a DELTREE).

Also one person has said that they didn't want to shell to a DELTREE because that was slowing down his script...

and I wanted something to do I was trying to not use a shell command at all but the dir() command won't do subdirectories and i find it a little buggy at times.

Top
#49296 - 2000-03-30 05:31 AM Re: del *.tmp in C:\windows\temp
Anonymous
Unregistered


Bryce,

it looks nice, but there is a script error : unkwon command: dim $tempdir_data[99999]
What to do on this ?

nick

Top
#49297 - 2000-03-30 11:41 AM Re: del *.tmp in C:\windows\temp
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
works fine for me.... what version of kix are you using? I am using 3.62
Top
Page 1 of 2 12>


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

Who's Online
1 registered (Allen) and 1198 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.064 seconds in which 0.025 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