Last active
May 8, 2016 16:43
-
-
Save davidruhmann/a54de166e3bbf5d4a383 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$pick = ls -recurse -include *.bmp,*.jpg,*.png | sort lastwritetime | select -index 0; (ls $pick).LastWriteTime = Get-Date; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$deck = ls -recurse -include *.bmp,*.jpg,*.png | sort lastwritetime | select -first 3; $index = get-random -minimum 0 -maximum $deck.count; $pick = ls $deck | select -index $index; (ls $pick).LastWriteTime = Get-Date; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-16"?> | |
<Task version="1.3" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> | |
<RegistrationInfo> | |
<Date>2015-02-11T10:06:22.6992337</Date> | |
<Author>DavidRuhmann</Author> | |
</RegistrationInfo> | |
<Triggers> | |
<TimeTrigger> | |
<Repetition> | |
<Interval>PT20M</Interval> | |
<StopAtDurationEnd>false</StopAtDurationEnd> | |
</Repetition> | |
<StartBoundary>2015-02-11T10:05:17.837334</StartBoundary> | |
<ExecutionTimeLimit>PT2M</ExecutionTimeLimit> | |
<Enabled>true</Enabled> | |
</TimeTrigger> | |
</Triggers> | |
<Principals> | |
<Principal id="Author"> | |
<UserId>User</UserId> | |
<LogonType>InteractiveToken</LogonType> | |
<RunLevel>LeastPrivilege</RunLevel> | |
</Principal> | |
</Principals> | |
<Settings> | |
<MultipleInstancesPolicy>StopExisting</MultipleInstancesPolicy> | |
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries> | |
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries> | |
<AllowHardTerminate>true</AllowHardTerminate> | |
<StartWhenAvailable>false</StartWhenAvailable> | |
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable> | |
<IdleSettings> | |
<StopOnIdleEnd>true</StopOnIdleEnd> | |
<RestartOnIdle>false</RestartOnIdle> | |
</IdleSettings> | |
<AllowStartOnDemand>true</AllowStartOnDemand> | |
<Enabled>true</Enabled> | |
<Hidden>true</Hidden> | |
<RunOnlyIfIdle>false</RunOnlyIfIdle> | |
<DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession> | |
<UseUnifiedSchedulingEngine>false</UseUnifiedSchedulingEngine> | |
<WakeToRun>false</WakeToRun> | |
<ExecutionTimeLimit>PT2M</ExecutionTimeLimit> | |
<Priority>7</Priority> | |
</Settings> | |
<Actions Context="Author"> | |
<Exec> | |
<Command>HiddenTask.vbs</Command> | |
<Arguments>powershell -command "$total = ls -recurse -include *.bmp,*.jpg,*.png | measure | select count; $index = get-random -minimum 1 -maximum $total.count; $pick = ls -recurse -include *.bmp,*.jpg,*.png | select -index $index; set-itemproperty -path 'HKCU:Control Panel\Desktop' -name wallpaper -value $pick.fullname; $path = $env:appdata + '\Microsoft\Windows\Themes'; $tw = $path + '\TranscodedWallpaper'; $ini = $path + '\slideshow.ini'; del $tw; clc $ini; $signature = '[DllImport(' + [char]0x22 + 'user32.dll' + [char]0x22 +', SetLastError = true, CharSet = CharSet.Auto)] public static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);'; $type = Add-Type -MemberDefinition $signature -Name Win32Utils -Namespace SystemParametersInfo -PassThru; $type::SystemParametersInfo(20, 0, $pick.fullname, 0x01 -bor 0x02); rundll32.exe user32.dll, UpdatePerUserSystemParameters;"</Arguments> | |
<WorkingDirectory>%UserProfile%\Pictures\Backgrounds\Show</WorkingDirectory> | |
</Exec> | |
</Actions> | |
</Task> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hiddentask.vbs gives a runtime error on windows 10, line 3 char 1, subscript out of range code 800A0009