i'm trying write script in powershell, start application , show user in pop-up when application used last time. well, start application used simple command, working, don't know if it's efficient in long term:
start 'c:\riot games\league of legends\leagueclient.exe'
and after started application , pop-up should tell me, when last time started application. that's goal now.
you open program using
start 'c:\riot games\league of legends\leagueclient.exe'
and pop like...
#first want set variable date , time #get-itemproperty self explanatoy #select-object gets lastaccestime property , -expand isolates property in string versus table $lastusetime = get-itemproperty "c:\riot games\league of legends\leagueclient.exe" | select-object -expandproperty lastaccesstime #set com object window , give variable $wshell = new-object -comobject wscript.shell #use variable , "pop up" property of windows shell set windows details. void disables outputs in powershell window [void]$wshell.popup("last open $lastusetime",0,"program details",0x1)
to more information on wscript.shell object can go this link
there other ways of doing how chose it.
Comments
Post a Comment