Hi All,
Wondering if anyone can help, I'm attempting to delete a .ost file from a users roaming profile, I'm using the following code:
Dim strComputer, oWSH, oWMI, oFSO, AppDataFolder
strComputer = "."
Set oWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set oWSH = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
AppDataFolder = oWSH.ExpandEnvironmentStrings("%appdata%")
For Each file As String In IO.Directory.GetFiles(AppDataFolder & "\Thinstall\Microsoft Standard 2010 KMS\%Local AppData%\Microsoft\Outlook","*.ost")
IO.File.Delete(file)
Next
I keep getting "Expected In" error message on line 9 char 15. Any idea why? Sorry but I literally do no VB coding so am a bit lost.
Regards,
Ross
Wondering if anyone can help, I'm attempting to delete a .ost file from a users roaming profile, I'm using the following code:
Dim strComputer, oWSH, oWMI, oFSO, AppDataFolder
strComputer = "."
Set oWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set oWSH = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
AppDataFolder = oWSH.ExpandEnvironmentStrings("%appdata%")
For Each file As String In IO.Directory.GetFiles(AppDataFolder & "\Thinstall\Microsoft Standard 2010 KMS\%Local AppData%\Microsoft\Outlook","*.ost")
IO.File.Delete(file)
Next
I keep getting "Expected In" error message on line 9 char 15. Any idea why? Sorry but I literally do no VB coding so am a bit lost.
Regards,
Ross