Refreshing Desktop after Batch Runs

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
kmsan4rd
Posts: 1
Joined: 06 Apr 2016 09:20

Refreshing Desktop after Batch Runs

#1 Post by kmsan4rd » 06 Apr 2016 09:28

Hello,

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"

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Refreshing Desktop after Batch Runs

#2 Post by foxidrive » 06 Apr 2016 12:35

Did you paste your code in above?

It's not quite right... the last line won't run due to the formatting error.

Post Reply