I want to learn how to create a vbs script to delete Windows\temp files. Can anyone help me?
Edited by Orange Blossom, 28 January 2015 - 02:30 AM.
Moved to more appropriate forum. ~ OB
Posted 27 January 2015 - 08:41 PM
I want to learn how to create a vbs script to delete Windows\temp files. Can anyone help me?
Edited by Orange Blossom, 28 January 2015 - 02:30 AM.
Moved to more appropriate forum. ~ OB
Posted 27 January 2015 - 09:04 PM
why does it have to be VBS?
"If you don't understand how your computer works, you shouldn't be messing with it!"
Posted 27 January 2015 - 09:18 PM
Because I have to run it on all of my library computers. We have Insight Management software and it has been crashing and doing backups in C:\Windows\temp and is using all of the hard drive space. I just want to do a quick dump of the temp files, then I need to update the program to the newest version. Would a batch file work and if so how to write that.
Posted 28 January 2015 - 02:28 AM
After years of frikin around with Win 7I want to learn how to create a vbs script to delete Windows\temp files. Can anyone help me?
Posted 28 January 2015 - 06:40 PM
I want to learn how to create a vbs script to delete Windows\temp files. Can anyone help me?
You mean somethign simple like so? I forgot to mention the files wont be in the recycle bin after the deletion takes place!
'Set the file system object
Set filesysobj = CreateObject("Scripting.FileSystemObject")
' set the folder target
Set folder = filesysobj.GetFolder("C:\Windows\Temp")
'set the collector (cof = collection of files)
Set cof = folder.Files
'start the for each loop
For Each file in cof
'delete each file
file.Delete
Next
'clean up
Set filesysobj = Nothing
Set folder = Nothing
Set cof = Nothing
Now create a GPO at logon and simpyl add this script and it will delete the files, ensure people ahve write access/delete access to that folder as well.
Edited by JohnnyJammer, 28 January 2015 - 06:42 PM.
0 members, 1 guests, 0 anonymous users