Solved

script to change screen colour

Posted on 2011-02-23
13
329 Views
Last Modified: 2012-05-11
I have some 2000 Terminal Servers where for one reason or another the screen colors and the default printer will change.   As a quickfix for users I  would like to give them a button that would switch the screen colours/background and the default printers back to what they want. One problem is that in order for the screens and default printer to be reverted the user would have to have admin rights.  I would like to

1) have a script that would do this

2) point a shortcut  on their desktop to this script so that when they click it will start a process that has enough  rights to switch things back  - in other words elevate the process to run as admin without the user entering admin name and password
0
Comment
Question by:lineonecorp
  • 7
  • 6
13 Comments
 
LVL 30

Accepted Solution

by:
SiddharthRout earned 300 total points
ID: 34969834
Try this for changing the wallpaper. Save this code in a text file and save it as a .VBS. Once done, right click on the file and click on properties. In the security tab, give it full admin rights.

Dim ws, strUser

Set ws = WScript.CreateObject("WScript.Shell")
strUser = ws.ExpandEnvironmentStrings("%USERNAME%")

Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")

sWinDir = oFSO.GetSpecialFolder(0)
sWallPaper = "c:\MYFile.bmp"

'~~> Update in registry
oShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", sWallPaper
'~~> Update system
oShell.Run "%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True

Open in new window


Now regarding the printers...
>>default printers back to what they want.

How will the code decide what users want? Do you want to specify some constant printer for all of them? If yes then you might use the GPO for that?

Sid
0
 

Author Comment

by:lineonecorp
ID: 34973202
Thanks for the code. I am assuming that I can create a shortcut to it on the desktop of the user in question?

As far as the printer, yes, I want to specify a specific printer for one or more persons who are experiencing the problem but not for the whole organization. Could I do that via a script like the screen colour script?

I will try the screen colour script change in the meantime.
0
 
LVL 30

Assisted Solution

by:SiddharthRout
SiddharthRout earned 300 total points
ID: 34978958
Yes you can do that. But give it Admin Rights from the security tab. Did you try it?

>>Could I do that via a script like the screen colour script?

Yes, I think you can do it. Let me try it my printer.

Sid
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 30

Assisted Solution

by:SiddharthRout
SiddharthRout earned 300 total points
ID: 34978967
In fact you don't need to specify separate printers for separate users. You may let them choose if you want?

Sid
0
 

Author Comment

by:lineonecorp
ID: 34989114
No. In the case I'm talking about it would be just a few users who are to have a specific printer and a specific screen colour so no choice necessary.
0
 
LVL 30

Assisted Solution

by:SiddharthRout
SiddharthRout earned 300 total points
ID: 34989932
Ok. :)

Did you check the above script for wall paper?

Sid
0
 

Author Comment

by:lineonecorp
ID: 34992580
I'm going to check over the next few days. I will let you know.
0
 

Author Comment

by:lineonecorp
ID: 34995003
I think there's a little misunderstanding.  The problem is the background  we want to change is not an image file it’s a color code with the following information:
 
Hue=141
Sat=115
Lum=105
Red=58
Green=110
Blue=165
0
 
LVL 30

Assisted Solution

by:SiddharthRout
SiddharthRout earned 300 total points
ID: 34995948
Are you referring to theme(Appearance and Color Scheme)?

Sid
0
 

Author Comment

by:lineonecorp
ID: 35030913
Yes, I am referring to theme (Appearance and Colour Scheme).
0
 

Author Comment

by:lineonecorp
ID: 35187792
Still on this?
0
 
LVL 30

Assisted Solution

by:SiddharthRout
SiddharthRout earned 300 total points
ID: 35213890
Sorry, I was kinda busy...

See if this link helps?

Title: (appearance&color scheme) from a vbscript
http://stackoverflow.com/questions/697161/modify-xp-theme-appearancecolor-scheme-from-a-vbscript

Sid
0
 

Author Comment

by:lineonecorp
ID: 35220722
Thanks. Let me take a look.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question