Delete folder under Doc & Setting for all users
Updated: 21 May 2010 | 5 comments
Hi
I think this is the correct forum, I'm using Wise Installation System 9.
I need to loop thru all the existing users under Doc and Setting and remove a specific folder.
How can I do this?
F
Discussion Filed Under:
Comments
No elegant solution, but it can be done
There is no elegant solution to this, but it can be done.
What you need to do is to create a file containing all the folders under documents and settings
So you would use the Execute Program command to run something like this:
%SYS32%\cmd.exe /c dir /b /s "C:\Documents and Settings" > %TEMP%\dirlist.txt
(where %SYS%\cmd.exe is the "executable" and the rest of the line goes into the "argument" box )
Once you have the listing of all folders under docs and settings, you can use the "Read/Update text file" command to read through this file one line at a time until you find what you are looking for. Since the Read/update command is effectively a looping command, you can include a delete command in the loop, to run whenever your test parameters return true.
Your final code should delete the temp file you created to tidy up.
If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.
You can do this using a
You can do this using a vbscript.
Eshwar has gone for a vbscript using which we can copy files from all the user profiles to destination. You can change the script accordingly so that the script will delete a particular folder if exists. Here is the link:
https://www-secure.symantec.com/connect/downloads/backing-user-profiles-using-vbscript
Greetings,
Sushma
VBScript support
Wise Installation System 9 does not have native support for VBScript - this was only introduced in the Wisescript Editors shipping with Wise Package Studio 7 and Wise Installation Studio 7.
However, you can certainly use a vbscript to make the necessary folder deletions, and call it using the "Execute Program" command, by calling wscript.exe or cscript.exe as the "executable" and passing the full filename and path of the vbs file as the command argument.
If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.
Here's a wisescript that will do what you want.
This script will look in the registry for all local profiles on the PC and then searches for the folder "C:\Documents and Settings\$Usernames$\Application Data\ICAClient". Just modify the script for the desired location.
Local or Roaming profiles?
Nice script Michael....
fkish - Now would be a good time to check whether your environment uses local or roaming profiles, or a mix of both ?
If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.
Would you like to reply?
Login or Register to post your comment.