Hi All,

We are currently upgrading from workshare 5.2 to Workshare 8. I can uninstall workshare and I have a script that deletes both any remaining folders on the C drive and any HKLM reg keys. However we use roaming profiles so I need a way to delete both the %username%\appdata\roaming\Workshare and %username%\appdata\roaming\Workshare Upgrade folder or if thats not possible could you please advise if I could move the workshare appdata to the appdata\local folder thanks
4 Comments   [ + ] Show Comments

Comments

  • You are already using a script, aren't you able to use the same script to serve this purpose.
    • There's another problem, he first needs to know the names of the profiles in C:\Users, because %username% uses the current logged in user in variable.
  • Actually, he'll just use the variable for: %APPDATA%, this should take care of it.
  • But as he said, they are using ROAMING PROFILES, so user has to be logged on a machine to get his current profile loaded to C:\User\<username> folder.
    In my opinion you could use some script in ActiveSetup which will delete files from %APPDATA% at first logon.
  • That's another approach.
Please log in to comment

Answers

1
if you wanted to use PowerShell then you could try something like this. There are shorter versions i'm sure but his has worked for me in the past.

#This gets the current username
$User = get-content env:username

#This sets the $Location to the Users Roaming folder
$Location = Set-Location -Path ("C:\users\" + $User + "\AppData\Roaming")

#This deletes the folders and its contents
Remove-Item ($Location + "Workshare") -Recurse
Remove-Item ($Location + "Workshare Upgrade") -Recurse
Answered 08/19/2014 by: Partridge2k
White Belt

Please log in to comment
1

If using an MSI route...
create the appropriate remove file tables, (yes this will only remove files for the person uninstalling), you  could add the script as a customaction, to do recursive check.

But do you need to??

If the app is uninstalled, the files in the user profile will remain, being 'orphaned', that's not such a big problem.

If there is a newer version of the app, and it doesn't get on well with the older version of the files, create the newer MSI to do a nice self repair to put down 'correct files' for the newer app.

OR, you could create a component to remove the old files, HKCU key path, when the repair happens it will remove the older files from the users profile. When the app launches, it should then create the files it needs.

Hopefully that will work and you wont have to set the correct orders for it to delete files, then copy new files.

good luck

 

Answered 08/21/2014 by: Badger
Red Belt

Please log in to comment
0
In batch it shoul be something like that:

dir /b C:\Users > dir.txt
FOR /F %%g IN (dir.txt) DO rmdir C:\%%G\AppData\Roaming\Workshare



Answered 08/19/2014 by: vos
White Belt

Please log in to comment
0
http://scriptingcenter.blogspot.in/2011/10/copy-file-to-appdata-based-on-operating.html

This script needs some modification but should help in anyway..
Answered 08/20/2014 by: rock_star
Black Belt

Please log in to comment
Answer this question or Comment on this question for clarity