I am trying to refresh the Desktop after my Batch File Runs. I have the following code but not sure why it will not refresh the screen so that the files that are deleted are removed.
Code: Select all
@echo off
set SCRIPT="%TEMP%\%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%.vbs"
echo Set oWS = WScript.CreateObject("WScript.Shell") >> %SCRIPT%
echo sLinkFile = "%USERPROFILE%\Desktop\Athena.lnk" >> %SCRIPT%
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> %SCRIPT%
echo olink.IconLocation = "%USERPROFILE%\Desktop\athena1.ico" >> %SCRIPT%
echo oLink.TargetPath = "https://athenanetsso.athenahealth.com/sp/startSSO.ping?PartnerIdpId=http://edc-adfs-
lb.chw.edu/adfs/services/trust&TargetResource=https://athenanet.athenahealth.com/" >> %SCRIPT%
echo oLink.Save >> %SCRIPT%
cscript /nologo %SCRIPT%
cd "%USERPROFILE%\Desktop\"
del "athena1.ico"
del %SCRIPT%
>"%temp%\tmp.vbs" echo WScript.Sleep 05 : CreateObject("WScript.Shell").SendKeys "{F5}"start "" "%temp%\tmp.vbs"