Jump to content

help! batch file changing windows 7 theme


Recommended Posts

i don't know what i'm doing wrong... here's the code...

if %TIME:~0,2% GEQ 8

(

if %TIME:~0,2% LEQ 16

(

rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Windows\Resources\Themes\1.theme"

)

else

(

rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Windows\Resources\Themes\2.theme"

)

)

else

(

rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Windows\Resources\Themes\2.theme"

)

thanks in advance...

Edited by scrapcode
Link to comment
Share on other sites


nvm guys... found the solution.. sorry for the noob question

@ECHO OFF

:begin

cls

IF %TIME:~0,2% GEQ 8 (goto one) else (goto two)

:one

IF %TIME:~0,2% LEQ 16 (goto three) else (goto two)

:two

rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Users\admin\AppData\Local\Microsoft\Windows\Themes\2.theme"

:three

rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Users\admin\AppData\Local\Microsoft\Windows\Themes\1.theme"

:end

Link to comment
Share on other sites

final version...

added another if for another theme and found a code which closes the Personalization window...

@ECHO OFF

:begin

cls

:_Setup

Set _Win1=Personalization

Set _Win2=Screen Resolution

Set _VBFile=%Temp%\~Temp@.vbs

:: Create VBScript in Temp folder

(Echo.On Error Resume Next

Echo.strTitle = WScript.Arguments.Item^(0^)

Echo.' Create a Word object

Echo.Set objWord = CreateObject^("Word.Application"^)

Echo.' Generate a collection containing the open windows

Echo.Set colTasks = objWord.Tasks

Echo.' Search for the windows title that was passed as parameter

Echo.For Each objTask In colTasks

Echo.If objTask.Name = strTitle Then colTasks^(objTask.Name^).Close

Echo.Next

Echo.objWord.Quit)>"%_VBFile%"

IF %TIME:~0,2% GEQ 8 (goto one) else (goto two)

:one

IF %TIME:~0,2% LEQ 18 (goto three) else (goto two)

:two

rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Users\admin\AppData\Local\Microsoft\Windows\Themes\2.theme"

Cscript //nologo %_VBFile% "%_Win1%"

goto end

:three

IF %TIME:~0,2% GEQ 16 (goto five) else (goto four)

:four

rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Users\admin\AppData\Local\Microsoft\Windows\Themes\1.theme"

Cscript //nologo %_VBFile% "%_Win1%"

goto end

:five

rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Users\admin\AppData\Local\Microsoft\Windows\Themes\3.theme"

Cscript //nologo %_VBFile% "%_Win1%"

:end

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...