Solved

script to change screen colour

Posted on 2011-02-23
13
327 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
 
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

706 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now