Advertisement

03.19.2005 at 03:00PM PST, ID: 21357336
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

Create a please wait window in VBscript

Asked by wolfbane360 in Miscellaneous Programming, Regular Expressions

Tags: ,

Hi, I have a VBscript that deletes local profiles on my workstations.  The thing is whilst the script is running you can't tell that it's working.  Is there a way to display a window that says something like "please wait, deleting profiles" until the whole script is complete.

My VBscript is:

Set shell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set regex = New RegExp
'Get logged in users profile
userProfile = shell.ExpandEnvironmentStrings("%USERPROFILE%")
userName = shell.ExpandEnvironmentStrings("%USERNAME%")
'manipulate userProfile string to get the profile directory
strProfileDir = Left(userProfile, InStrRev(userProfile, "\"))
With regex
'below is the regular expression pattern that is tested against the profile name\
'you will need to add the string of profiles you DO NOT WANT DELETED here followed
'by the pipe character "|". Hopefully this makes sense.
.pattern = "Admin*|sweepupd|administrator|all users|default user|localservice|networkservice|" & userName
.Ignorecase = True
.global = True
End With
Set objProfileDir = fso.GetFolder(strProfileDir)
Set colUserProfiles = objProfileDir.SubFolders
For Each profile In colUserProfiles
 If Not regex.Test(profile.name) Then
  if DateDiff("d", profile.DateLastModified, Now()) < 365 Then
   'WScript.Echo "Deleting Folder " &  strProfileDir & profile.Name & "\"
   'uncomment the following line once you are certain of the folders you want deleted.
   fso.DeleteFolder strProfileDir & profile.Name, TRUE
  End If
 End If
Next

WScript.Echo "Completed deleting profiles"


Many thanks.

Ryan PowellStart Free Trial
[+][-]03.19.2005 at 03:47PM PST, ID: 13583929

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.20.2005 at 12:39AM PST, ID: 13584901

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.21.2005 at 08:37AM PST, ID: 13592626

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Miscellaneous Programming, Regular Expressions
Tags: vbscript, window
Sign Up Now!
Solution Provided By: bkdc
Participating Experts: 2
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32