Forum CDRinfo.pl

Forum CDRinfo.pl (https://forum.cdrinfo.pl/)
-   Komputery - oprogramowanie i sprzęt (https://forum.cdrinfo.pl/f113/)
-   -   Rotator tapet (https://forum.cdrinfo.pl/f113/rotator-tapet-96236/)

Berion 14.02.2017 17:03

Rotator tapet
 
Taki plan zrodził się w mojej głowie, aby cztery razy w ciągu dnia, podczas czterech pór roku, Windows sam zmieniał tapety przy logowaniu na wcześniej ustalone.

Aby nie szukać jakichś programów postanowiłem napisać skrypt BAT i wywoływać go przez Harmonogram Zadań. Tylko, że działa to losowo... :sciana:

Kod:

REG ADD "HKCU\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d C:\Users\qwerty\rotator\zima_1.jpg /f
REG ADD "HKCU\Control Panel\Desktop" /v WallpaperStyle /t REG_SZ /d 10 /f
REG ADD "HKCU\Control Panel\Desktop" /v TileWallpaper /t REG_SZ /d 0 /f
RUNDLL32.EXE USER32.DLL, UpdatePerUserSystemParameters

Problemem jest ta ostatnia linijka. Czasem działa, a czasem nie. Dlaczego?

Niżej przykład XML do HZ:
Kod:

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.3" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2017-02-13T00:40:54.364408</Date>
    <Author>HAL9000\qwerty</Author>
  </RegistrationInfo>
  <Triggers>
    <CalendarTrigger>
      <StartBoundary>2016-11-01T00:06:00</StartBoundary>
      <EndBoundary>2017-03-01T00:05:59</EndBoundary>
      <Enabled>true</Enabled>
      <ScheduleByDay>
        <DaysInterval>1</DaysInterval>
      </ScheduleByDay>
    </CalendarTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>HAL9000\qwerty</UserId>
      <LogonType>InteractiveToken</LogonType>
      <RunLevel>LeastPrivilege</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>true</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
    <UseUnifiedSchedulingEngine>false</UseUnifiedSchedulingEngine>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>C:\Users\qwerty\rotator\zima_rano.bat</Command>
    </Exec>
  </Actions>
</Task>



Wszystkie czasy w strefie CET. Aktualna godzina: 16:16.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.