You are here

Change windows theme, and revert when usb is disconnected

28 posts / 0 new
Last post
fivetwentyfour
Offline
Last seen: 13 years 6 months ago
Joined: 2006-10-24 17:07
Change windows theme, and revert when usb is disconnected

Hey, I've figured a way how to change the theme of the computer when i plug in my usb drive and then revert it back when i disconnect. Would anybody be interested in hearing how?

Mgamerz
Offline
Last seen: 14 years 2 months ago
Joined: 2006-11-20 19:15
Ya, that would be cool,

Ya, that would be cool, except when ejecting it would take a while as comps nowadays-at 768MB ram and 1.8 ghz, it takes like 10 secs to do it, but it would be nice, if it doesn't have lots of sounds. So, how do you do it?

Portable Apps are cool, when coupled with U3 drives. All Portable apps should also be for U3!
~Whoa OLD~

fivetwentyfour
Offline
Last seen: 13 years 6 months ago
Joined: 2006-10-24 17:07
Ok well i used and

Ok well i used and application called AutoIT. AutoIT lets you create sendkey scripts , it also allows you to convert these scripts into stand alone exe files. AutoIT is freeware so if you Google it then I'm sure you can find it easily.

Any way, i've created a batch file for when i start up and a batch file to shutdown, to portablize my google talk and picasa. any way these batch files just simply export the current registry setting and appdata file and import mine and when the shutdown batch file is run it exports my data and restores the original reg and appdata. these batch files also handle the theme swapping. Still getting there lol.

So i got AutoIT and created a start up script that i converted to and exe that looks like this:

Run("C:\Windows\system32\rundll32.exe Shell32.dll,Control_RunDLL desk.cpl desk,@Themes")
WinWaitActive("Display Properties")
Send("!s")
WinWaitActive("Save As")
Send("C:\restore.theme")
Send("!s")
Send("!y")
WinWaitActive("Display Properties")
Send("b")
WinWaitActive("Open Theme")
Send("C:\MSV.Theme")
Send("!o")
WinWaitActive("Display Properties")
Send("{ENTER}")

this is run at start up automatically by the start up batch file, takes a split second

now this imports the MSV theme, from the system root, which is my theme and exports the current user theme to the system root. I've set up my startup batch file to additionally copy my theme, and the wallpaper image file to the system root and an empty theme called restore.theme that will be over written with the current theme.

on shut down i created this script that i converted using AutoIT into an exe

Run("C:\Windows\system32\rundll32.exe Shell32.dll,Control_RunDLL desk.cpl desk,@Themes")
WinWaitActive("Display Properties")
Send("b")
WinWaitActive("Open Theme")
Send("C:\Restore.Theme")
Send("!o")
WinWaitActive("Display Properties")
Send("{ENTER}")

this is run automaticaly from the shutdown batch file which applies the saved restore theme. Then the shutdown batch file deletes the the MSV.theme, restore.theme and the wallpaper file from the system root.

the msv theme has to initially be edited after creating it using a notepad to change the wallpaper path to just wallpaper.png/jpg so thats its relative to the msv.theme file!

after the shutdown batch file is run then the drive can be disconnected. I've set the start up app to work as an autoplay that starts pstart and i've created a button called shutdown in my pstart that i have set to activate when i exit pstart

tell me what you guys think??

Mgamerz
Offline
Last seen: 14 years 2 months ago
Joined: 2006-11-20 19:15
If program then easier

I haven't a clue what you said, I'm not that deep into computers yet. I'm better with hardware and stuff. This would be a extremely nice program to have, as if it was easier to use and like wallpaper swapper for U3. Very nice though.

Portable Apps are cool, when coupled with U3 drives. All Portable apps should also be for U3 also!

Portable Apps are cool, when coupled with U3 drives. All Portable apps should also be for U3!
~Whoa OLD~

Keviin
Offline
Last seen: 14 years 5 months ago
Joined: 2006-11-25 06:04
ahh mann wdhh?? lol i dun

ahh mann wdhh?? lol i dun understand wat ur sayin mann. make the program n host it somwhere so we can dl? include simplified instruction or jus make a folder in the program where we can add wat theme we want to be applied to windows yeah? this program sounds kool. i like to customize how my computer looks and this sounds great. but then i dun understand wat ur sayin..

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 12 years 10 months ago
Joined: 2006-01-06 21:27
WTF?

You make absolutely no sense.
----
Ryan McCue
Cube Games
Life is like a sewer. What you get out of it depends on what you put into it.
(Tom Lehrer)

"If you're not part of the solution, you're part of the precipitate."

Keviin
Offline
Last seen: 14 years 5 months ago
Joined: 2006-11-25 06:04
nice!

lmao nice!!! i finaly got it too work Pardon thanks mann leet script! lolz btw ur zip doesnt work got corruption, i dernoes.. i used autoit u mucked aorund with it lolz thankx btw

Keviin
Offline
Last seen: 14 years 5 months ago
Joined: 2006-11-25 06:04
kool

hey but is there a for the msv.theme to be ran from the usb? cause like nearly every machine i plug my usb into it assigns a diffrent drive letter for my usb.. soo yeh do u noe a command so it run from the sb instead? yehhhh... it'll be great if u can Pardon

fivetwentyfour
Offline
Last seen: 13 years 6 months ago
Joined: 2006-10-24 17:07
Kevin

Kevin:

here is a 7zip version. Regarding running from the USB: Download my app and see how it works. It temporarily copies the theme file and the wallpaper to the root of the C drive. Therefore it does not matter what letter you drive is assigned to becuase its reading it from the root of the local drive which will be 100% constant on any windows machine. After your session on the pc those temporary files in the root of C drive are removed. In the package I've also included a utility that automatically hides the desktop icons so that your theme is not polluted by the computers icons. Please tho, read the read me file cos its got the exact instructions on how to operate the app.

Auto Theme.7z (394kb)

Keviin
Offline
Last seen: 14 years 5 months ago
Joined: 2006-11-25 06:04
7zZzZz...

errr... is it just me or are these .zip n .7z arnt workin? i cant extract it. i tried using both winrar and 7z n it doesnt work.. lolz

Bahamut
Bahamut's picture
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-07 08:44
I had no problem. Try

I had no problem. Try downloading it again.

Vintage!

fivetwentyfour
Offline
Last seen: 13 years 6 months ago
Joined: 2006-10-24 17:07
Additionaly i also use a

Additionaly i also use a command line utility called nircmd, which is run in the start up and shutdown batch files to hide all the desktop icons and restore them upon shutdowm

Start up:
nircmd.exe win hide class progman

and on shutdown:
nircmd.exe win show class progman

Bahamut
Bahamut's picture
Offline
Last seen: 10 years 8 months ago
Joined: 2006-04-07 08:44
reschange

There's a program called reschange that allows one to change the display properties (including resolution, of course) via command line.

http://www.12noon.com/reschange.htm

Vintage!

fivetwentyfour
Offline
Last seen: 13 years 6 months ago
Joined: 2006-10-24 17:07
Here you go, I've packaged

Here you go, I've packaged it neatly for you guys. Please be sure to read the Read File!

Auto Theme.zip (573kb)

fivetwentyfour
Offline
Last seen: 13 years 6 months ago
Joined: 2006-10-24 17:07
One More Thing

A small detail i overlooked regarding the screen saver. Please download the new MSV.theme file and replace the old MSV.theme file in the Autotheme.zip package. The screen saver will now work correctly. Hope you guys find this useful. One more thing I also forgot to mention is that this will only work on XP systems.

MSV.theme

anyoneelse
Offline
Last seen: 12 years 10 months ago
Joined: 2006-11-24 07:01
I think its a great

I think its a great idea...
But, not easy to use, I just downloaded, so I'm sure I'm gonna make it work in a little while, but its not simple.

Anyway, Thanks.

Andres

Andres Smile

arqbrulo
arqbrulo's picture
Offline
Last seen: 2 years 6 months ago
Joined: 2006-08-10 16:38
I was able to use it

I'm not much of a computer guy, but just at looking at the program, and the script that fivetwentyfour wrote, I was able to figure out how to use it. If I could do it, anybody can do it.
---------------
Teen1: Oh, here comes that cannonball guy. He's cool.
Teen2: Are you being sarcastic, dude?
Teen1: I don't even know anymore.

"In three words I can sum up everything I've learned about life: it goes on." -- Robert Frost
"In three words I can sum up everything I've learned about life: baby ain't mine." -- Adam Holguin

fivetwentyfour
Offline
Last seen: 13 years 6 months ago
Joined: 2006-10-24 17:07
I hope contribution has

I hope my contribution has helped you guys.

Mgamerz
Offline
Last seen: 14 years 2 months ago
Joined: 2006-11-20 19:15
So... IF error happens, what happens?

So if the flash drive lost connection, or the computer froze or it was pulled out before it was ended, does the program automatically change the theme back to normal? And does it go automatically? Because... The school does not like when I change this kind of stuff, they think I'm actually changing the computer.

Portable Apps are cool, when coupled with U3 drives. All Portable apps should also be for U3!
~Whoa OLD~

fivetwentyfour
Offline
Last seen: 13 years 6 months ago
Joined: 2006-10-24 17:07
Well unfortunately if the pc

Well unfortunately if the pc crashes or the USB device is disconnected the auto theme app will not automatically revert the theme. Thats why it needs to be run again at shutdown. However if it happens that the USB is disconnected or the pc freezes you can always revert the pc back to its original theme manually, by double clicked on the Restore.Theme file in the root of the C:\ drive that was saved when auto theme was started up.

arqbrulo
arqbrulo's picture
Offline
Last seen: 2 years 6 months ago
Joined: 2006-08-10 16:38
Another option

If you dont want to have "C:\restore.theme" on every computer you change the theme on you can try this instead:

First of all, you might want to create a folder, let's say "Theme" inside your drive and in there save your whole theme (example - it should be have "RoyalFour.theme" and a folder called "RoyalFour")(FYI- You can edit *.theme files using notepad, to make sure it's portable change all the paths relative to "RoyalFour.theme" like .\RoyalFour\Wallpaper\wallpaper.bmp, etc.)

To use your own theme:

$current=RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\LastTheme", "ThemeFile")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\LastTheme", "Temp", "REG_EXPAND_SZ", $current)
Run("rundll32.exe Shell32.dll,Control_RunDLL desk.cpl desk,@Themes")
WinWaitActive("Display Properties")
Send("b")
Send(@ScriptDir & " \Theme\RoyalFour.theme")
Send("!o")
WinWaitActive("Display Properties")
Send("{ENTER}")

To set the last theme:

$current=RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\LastTheme", "Temp")
Run("rundll32.exe Shell32.dll,Control_RunDLL desk.cpl desk,@Themes")
WinWaitActive("Display Properties")
Send("b")
Send($current)
Send("!o")
WinWaitActive("Display Properties")
Send("{ENTER}")
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\LastTheme", "Temp")

One of the reasons I did this was because my computer at work all of a sudden did not let me save the theme. Everything would work just fine, but the *.theme file was not created. Also, I can make sure the whatever theme was on that computer before, It will still be there once I leave.
---------------
Teen1: Oh, here comes that cannonball guy. He's cool.
Teen2: Are you being sarcastic, dude?
Teen1: I don't even know anymore.

"In three words I can sum up everything I've learned about life: it goes on." -- Robert Frost
"In three words I can sum up everything I've learned about life: baby ain't mine." -- Adam Holguin

redostrike
Offline
Last seen: 15 years 8 months ago
Joined: 2006-12-12 07:48
Nice app. Not only for

Nice app. Not only for portable apps also for just doing stuff faster. I only was thinken how you start it when you put in the usb without doing anything clicking the exe or something.

Only Heroes live forever

arqbrulo
arqbrulo's picture
Offline
Last seen: 2 years 6 months ago
Joined: 2006-08-10 16:38
Autorun.inf

Just make an autorun.inf file, a pop-up dialog appears, all you need to do is hit enter. Search this site for diferent programs that can help you out. You can also integrate it with AutoStart
---------------
Teen1: Oh, here comes that cannonball guy. He's cool.
Teen2: Are you being sarcastic, dude?
Teen1: I don't even know anymore.

"In three words I can sum up everything I've learned about life: it goes on." -- Robert Frost
"In three words I can sum up everything I've learned about life: baby ain't mine." -- Adam Holguin

redostrike
Offline
Last seen: 15 years 8 months ago
Joined: 2006-12-12 07:48
AutoINF

Nice love the AutoInf program. Running soft this way in windows XP still pops up the Run window but it does the job quite good then you still can Cancel the process. But acctully i wanna know if there is a way to disable this in your ini file or is it only posible from your windows!

Hmm maybe whit Windowblinds this would be cool to ...... .

Only Heroes live forever

pfeerick
pfeerick's picture
Offline
Last seen: 6 years 2 months ago
Joined: 2005-12-13 19:21
Search the forum!

As the previous commenter said, search the forum (re. disabling Windows XP AutoPlay dialog). It is possible to disable this dialog, AFAIK not device-specific, only computer specific.

The easiest way is to the use the AutoStart program (http://xpt.nl/products-autostart) on the machine the device is plugged into, and this will disable the AutoPlay prompt. It's really only of use for computers you own or frequently access (and have a user profile on).

For example, at my uni, the logged in users start menu folder is located on their network share, and because of this, I just placed AutoStart.exe in the startup folder on my network share. Whenever I log in, AutoStart launches, and waits for a USB device to be plugged in. It blocks the Windows XP autoplay nag screen and allows me to have easy access to the usb device(s) from the system tray, among other things.

redostrike
Offline
Last seen: 15 years 8 months ago
Joined: 2006-12-12 07:48
Yes i know it is possible

Yes i know it is possible whit the autostart program, but then again i wanted to know how you can do it in the autorun.inf file. I aqtully don't wanna use extra software to hold a f*king autoplay menu!!

Only Heroes live forever

pfeerick
pfeerick's picture
Offline
Last seen: 6 years 2 months ago
Joined: 2005-12-13 19:21
Well, the answer is, you can't!

Unless I've missed something somewhere, it's not possible to disable that stupid autoplay menu. The only thing you can do to it is customise the first item in the list.

arqbrulo
arqbrulo's picture
Offline
Last seen: 2 years 6 months ago
Joined: 2006-08-10 16:38
It's not recommended

There is a way to modify the registry so that it automatically run whatever's inserted in the usb port but it's not recommended. Read about it here.
---------------
Teen1: Oh, here comes that cannonball guy. He's cool.
Teen2: Are you being sarcastic, dude?
Teen1: I don't even know anymore.

"In three words I can sum up everything I've learned about life: it goes on." -- Robert Frost
"In three words I can sum up everything I've learned about life: baby ain't mine." -- Adam Holguin

Topic locked