Solved

script to change screen colour

Posted on 2011-02-23
13
332 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This is about my first experience with programming Arduino.
In this post we will learn different types of Android Layout and some basics of an Android App.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

695 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