Solved

script to change screen colour

Posted on 2011-02-23
13
328 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article will show, step by step, how to integrate R code into a R Sweave document
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
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 seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

948 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

23 Experts available now in Live!

Get 1:1 Help Now