Windows Scripting
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsSystem AdministrationWindows Scripting

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 2nd, 2007, 06:48 AM
hvaid hvaid is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2007
Posts: 3 hvaid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 49 m 51 sec
Reputation Power: 0
Question How do I use vbscript to automatically delete files in a Folder and Subfolders ?

Hello,
Please help me I want to delete the following from the servers profiles shares (profile$) automatically


jpcache
cookies
application data\adobe\acrobat
application data\microsoft\html help
application data\sun\java\deployment\cache
application data\jasc software inc\cache
and these file types
*.tmp* *~.* *.~* *.old file*.chk

Reply With Quote
  #2  
Old March 3rd, 2007, 12:11 AM
Nilpo's Avatar
Nilpo Nilpo is offline
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Jun 2006
Location: Salem, OH
Posts: 1,048 Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Days 12 h 32 m 33 sec
Reputation Power: 555
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo
MySpace
Please provide a little more detail. Are you running this script from the server? Are the profiles all housed on the server? What OS is the server running?

Is it safe to assume that all profiles are at C:\Documents and Settings\profilename?
__________________
Click the image if at any point you don't like my decision.

Scripting problems? Windows questions? Ask the Windows Guru!


Reply With Quote
  #3  
Old March 5th, 2007, 06:49 AM
hvaid hvaid is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2007
Posts: 3 hvaid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 49 m 51 sec
Reputation Power: 0
Quote:
Originally Posted by Nilpo
Please provide a little more detail. Are you running this script from the server? Are the profiles all housed on the server? What OS is the server running?

Is it safe to assume that all profiles are at C:\Documents and Settings\profilename?


Hi Niplo,
I have profiles stored in 4 windows 2003 servers.
The profiles loaation is F:\Profile Directory\profilesname...and shared as profiles$ om all the servers
We can run the script from the server.

Reply With Quote
  #4  
Old March 7th, 2007, 08:52 AM
Nilpo's Avatar
Nilpo Nilpo is offline
ASP Free Beginner (1000 - 1499 posts)
 
Join Date: Jun 2006
Location: Salem, OH
Posts: 1,048 Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)Nilpo User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1Folding Points: 206875 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Days 12 h 32 m 33 sec
Reputation Power: 555
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo
MySpace
Okay...a couple more questions...sorry.

You want to delete *.tmp* *~.* *.~* *.old file*.chk these files recursively starting at the root of your share, right? Meaning in any folder in or under it.

Also, jpcache, and cookies -- those are folders in your profile$ root?

And lastly...what kind of authentication are you using? Do you have an IUSR_Computername account on these machines or are you using an administrator account? And are you using Active Directory?

Basically, I'm trying to determine what the easiest method is for you. You can do this plainly with the FileSystemObject by providing paths, but authentication is sometimes tricky. You can also use WMI (DCOM/RPC) or LDAP (ADSI), but these are more complicated methods. A third option would be to run each of the scripts locally from each of the servers by copying it remotely via the WshController object.

Reply With Quote
  #5  
Old March 7th, 2007, 10:02 AM
hvaid hvaid is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2007
Posts: 3 hvaid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 49 m 51 sec
Reputation Power: 0
Quote:
Originally Posted by Nilpo
Okay...a couple more questions...sorry.

You want to delete *.tmp* *~.* *.~* *.old file*.chk these files recursively starting at the root of your share, right? Meaning in any folder in or under it.

Also, jpcache, and cookies -- those are folders in your profile$ root?

And lastly...what kind of authentication are you using? Do you have an IUSR_Computername account on these machines or are you using an administrator account? And are you using Active Directory?

Basically, I'm trying to determine what the easiest method is for you. You can do this plainly with the FileSystemObject by providing paths, but authentication is sometimes tricky. You can also use WMI (DCOM/RPC) or LDAP (ADSI), but these are more complicated methods. A third option would be to run each of the scripts locally from each of the servers by copying it remotely via the WshController object.



Your got it right that I want to delete *.tmp* *~.* *.~* *.old file*.chk all these files recursively starting at the root of your share in any folder in or under it also would like to delete any files under the jpcache, and cookies folders which are under my profile$ root...I have these two folders in every profile directory as I have romaing profiles.

I'm using Active directory but the 4 servers are member servers so I have both IUSR_Computername and administrators on those. I'm using these to keep the roaming profiles.

Reply With Quote
Reply

Viewing: ASP Free ForumsSystem AdministrationWindows Scripting > How do I use vbscript to automatically delete files in a Folder and Subfolders ?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT