Private Declare PtrSafe Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal lBuffer As Long) As Long

Sub myfolpath()
MyPath = "C:\appsensevirtual\S-1-5-21-2806722074-2201502681-4024131801-68768\{B3C35765-D8DA-4380-97B4-9B690734B8E1}\Microsoft Office 2016 0x2F; 365 Group\Device\HarddiskVolume2\Users\ajeet.prasad\AppData\Roaming\Microsoft\Excel"
MyPath = GetShortPath1(MyPath)
VBAF1_Function_T0_Delete_All_Files (MyPath)
End Sub


Public Function GetShortPath1(ByVal strLongPath As String) As String
    Dim sLongPath  As String
    Dim sShortPath As String
    Dim lPathLen   As Long
    Dim lLen       As Long
    
    sShortPath = Space$(255)
    lLen = Len(sShortPath)
    lPathLen = GetShortPathName(strLongPath, sShortPath, lLen)
    GetShortPath1 = Left$(sShortPath, lPathLen)
    
End Function


Sub VBAF1_Function_T0_Delete_All_Files(sFldPath As String)
    
    'Variable declaration
    Dim sFolderPath As String
    Dim sFileName As String, oFile As Object, oFolder As Folder
        
    'Check for slash
    If Right(sFldPath, 1) <> "\" Then sFldPath = sFldPath & "\"
        
    'Create FSO Object
    Set ofso = CreateObject("Scripting.FileSystemObject")
    Set oFolder = ofso.GetFolder(sFldPath)
    
    'Check Specified Folder exists or not
    If ofso.FolderExists(sFldPath) Then
        'Loop through each file in a specified folder
        For Each oFile In oFolder.Files
        Debug.Print oFile.Name
            If oFile.Name <> ThisWorkbook.Name Then
                'Delete file
                oFile.Delete
            End If
        Next
     End If
    'Check Subfolders in specified folder
    For Each oSubfolder In oFolder.SubFolders
    On Error Resume Next
        Kill oSubfolder.Path & "\*.*"
        RmDir oSubfolder
        'Recursive metod
        'Loop through all subfolders
        VBAF1_Function_T0_Delete_All_Files (sFldPath & oSubfolder.Name)
    Next
End Sub