hlmarine
asked on
VBS Scripting - Deleting Folder inside the current user profile
Hi,
I am looking for a script to delete a folder inside the current user AppData\Local\Microsoft\Ou tlook\test folder.
Here is the coding.
strPath = "%USERPROFILE%\AppData\Loc al\Microso ft\Outlook \Test"
WScript.Echo strPath
DeleteFolder strPath
Function DeleteFolder(strFolderPath )
Dim objFSO, objFolder
Set objFSO = CreateObject ("Scripting.FileSystemObje ct")
If objFSO.FolderExists(strFol derPath) Then
objFSO.DeleteFolder strFolderPath, True
End If
Set objFSO = Nothing
End Function
However, the coding only detect the strPath as the exact wording of %USERPROFILE%\AppData\Loca l\Microsof t\Outlook\ Test instead of C:\User\Username\AppData\L ocal\Micro soft\Outlo ok\Test.
Any expert can help ?
Thank you in advance !
I am looking for a script to delete a folder inside the current user AppData\Local\Microsoft\Ou
Here is the coding.
strPath = "%USERPROFILE%\AppData\Loc
WScript.Echo strPath
DeleteFolder strPath
Function DeleteFolder(strFolderPath
Dim objFSO, objFolder
Set objFSO = CreateObject ("Scripting.FileSystemObje
If objFSO.FolderExists(strFol
objFSO.DeleteFolder strFolderPath, True
End If
Set objFSO = Nothing
End Function
However, the coding only detect the strPath as the exact wording of %USERPROFILE%\AppData\Loca
Any expert can help ?
Thank you in advance !
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER