vbscript for running BGInfo in Terminal Server 2003

Hi Expert

I have two files: BGInfo.exe and TSWallpaper.bgi, save onto DFS path \\tcf.local\Support\TSTemplate.

I have the following vbscript:
Set objShell = WScript.CreateObject("WScript.Shell")
Username = "tcf.local\administrator"
Password = "password"
objShell.run "\\tcf.local\support\TSTemplate\BGInfo.exe TSWallpaper.bgi /timer:0 /SILENT /NOLICPROMPT",1 ,true

I logon as domain user account, it prompts for no permission to write into C:\WINDOWS folder.

Please help!
LVL 1
chekfuAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RobSampsonCommented:
Hi, I take it this command installs a screen-saver, which would copy files to the C:\Windows folder:
"\\tcf.local\support\TSTemplate\BGInfo.exe TSWallpaper.bgi /timer:0 /SILENT /NOLICPROMPT"

and a normal user is not going to have the rights to copy files there.
If you need to install the screensaver, you should be able to that as Admin, and it will be available to all users.  Otherwise, if you're trying to configure a timeout for the screensaver, you should be able to do this via Group Policy.

Regards,

Rob.
0
chekfuAuthor Commented:
Hello all

I managed to resolved it myself. Like to share. Here it go!

Set objShell = WScript.CreateObject("WScript.Shell")
'-------- DEFINE THE PROGRAM FILE LOCATION ---------
strExecuteFile = "\\tcf.local\Support\TSTemplate\bginfo.exe /NOLICPROMPT /timer:0 /all"

'-------- DEFINE THE CONFIGURATION FILE LOCATION ---------
'strConfigurationFile = ("\\tcf.local\Support\TSTemplate\TSWallpaper.bgi")

'-------- RUN COMMAND ---------
objShell.Exec strExecuteFile & strConfigurationFile
0
RobSampsonCommented:
Hi, that's great.  Doesn't seem like it would avoid any Unable to Write to Windows folder problem though, but as long as it works!

You should post a request in the Community Suport --> General zone to have this question either PAQed or deleted.

Regards,

Rob.
0
RobSampsonCommented:
Hi chekfu, I think that BGInfo does behave in a situation where it requires Admin rights (or at least specific rights to write to the Windows folder and certain parts of the registry).  I think that to provide this ability, you will need to copy your TSTemplate folder into the NetLogon folder of a domain contoller.  Then you can run a StartUp script, instead of a Login script, which will run under the system account, and you should be able to use the /all switch.  So, once you have moved the folder, you can use this:

Set objShell = WScript.CreateObject("WScript.Shell")
'-------- DEFINE THE PROGRAM FILE LOCATION ---------
strExecuteFile = "\\domain.com\sysvol\domain.com\scripts\TSTemplate\bginfo.exe /NOLICPROMPT /timer:0 /all"

'-------- DEFINE THE CONFIGURATION FILE LOCATION ---------
'strConfigurationFile = ("\\domain.com\sysvol\domain.com\scripts\TSTemplate\TSWallpaper.bgi")

'-------- RUN COMMAND ---------
objShell.Exec strExecuteFile & strConfigurationFile


Regards,

Rob.
0
RobSampsonCommented:
Hi chekfu, as oBdA mentioned in the other post of yours, change this:
'-------- RUN COMMAND ---------
objShell.Exec strExecuteFile & strConfigurationFile

to this
'-------- RUN COMMAND ---------
objShell.Exec strExecuteFile & " " & strConfigurationFile

Regards,

Rob.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.