I know there are some script junkies out there that could probably rock this out with their eyes closed. But I know nothing of scripting, so this may as well all be typed in Wingdings.

I need to modify a script we use to delete some folders. The problem being with our Citrix system is that the thinapp folders are sometimes duplicated and renamed.

Example:
Typically, the correct folder will read "OracleEBS". But sometimes an additional folder will be created with a .randomname, such as "OracleEBS.ABCD1234".

We have a script currently that will automatically delete the "OracleEBS" folder, but it won't touch the folder if it's labeled "OracleEBS.ABCD1234", so we have to rename the folder to "OracleEBS" so that it can be deleted by the script.

Here is what the script is currently:

@echo off
cls
echo .
echo ......Please wait....attempting to clear the sandbox......
echo .
"\\companyname.com\thinapp\oracleEBS\sleep\sleep.e xe" 10
if exist "%appdata%\Thinstall\OracleR12" rmdir "%appdata%\Thinstall\OracleR12" /S /Q
if exist "%appdata%\Thinstall\Oracle R12" rmdir "%appdata%\Thinstall\Oracle R12" /S /Q
if exist "%appdata%\Thinstall\OracleEBS*" rmdir "%appdata%\Thinstall\OracleEBS" /S /Q
echo ......Script Complete......
echo .
pause


Anyone know how I can modify it to work correctly?