Hi, > The .bat contains the following lines: > > cd /D %userprofile%\appdata\roaming\thunderbird\Profiles > for /D %%f in (*.default) do cd > "%userprofile%\appdata\roaming\thunderbird\Profiles\%%f\" > rd extensions /s /q > > I then added the corrispondent line to the package > > <install cmd='"\\servername\wpkg\software\Mozilla > Thunderbird\deletelightning.bat"' /> > > If i run the .bat file from the target PC, the folder is correctly deleted. > If the .bat is run via wpkg package, it returns an error > > "Could not process (install) package 'Mozilla Thunderbird' (Mozilla > Thunderbird):|Exit code returned non-successful value (2) on command > '"\\servername\wpkg\software\Mozilla Thunderbird\deletelightning.bat"' and > the folder is not deleted. > > Where am i wrong? Wpkg runs as system user (usually), so you cannot use %userprofile% of a logged in computer user. Perhaps you could make something like a "foreach" loop to go thru all user's profiles and delete the corresponding path. Or better use a domain logon script or something like that. But for sure, you should be careful, to not delete wrong data ... Best regards, Falko |