Unable to relaunch as Service in Terminal Server

Hi Experts
Please help. I have a GPO in the user logon vbscript in the following:

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

Users logon to Windows 2003 Terminal Server, encountered error message "Unable to relauch as a service".
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, why is this line:
'strConfigurationFile = ("\\tcf.local\Support\TSTemplate\TSWallpaper.bgi")

commented out?  Without that line being executed, you are only executing the strExecuteFile, and not the configuration file.  Would this be why it's trying to "relaunch" the application?

Regards,

Rob.
0
oBdACommented:
Remove the "/all", that's where the message is coming from; to start with, users don't have permissions to write into other user's folders.
You don't need it anyway, because bginfo is started with each user's logon.
Oh, and make sure that the bitmap location defined in the bgi file is not at the standard setting (%Systemroot%\system32); change this to the user's Temp or Application folder.
0
chekfuAuthor Commented:
Hello oBdA

You are right. I should removed "/all", however, it showed another error message:
===============================================
Error creating the output bitmap file
C:\WINDOWS\BGInfo.bmp:
Access is denied.
Please ensure the path the exists and you have permission to write it.
You can select a different output path for the bitmap using the Bitmap|Location menu item.
===============================================
I have confirmed again and again. The output bitmap is User's application data directory (%USERPROFILE%\Local Settings\Application Data\Winternals\BGInfo\BGInfo.bmp). I have another bgi configuration file, the output bitmap is manually set to (%USERPROFILE%\Local Settings\Application Data\BGInfo\BGInfo.bmp).
I have still encountered the same error message when I double-click the vbscript file manually. BGINFO always prompt for saving onto C:\WINDOWS\BGinfo.bmp.

Please help!
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

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
oBdACommented:
Then it's not reading your bgi file.
Note that, as RobSampson already mentioned, the line where the bgi file to be used is commented out, so bginfo will run with default settings.
>' strConfigurationFile = ("\\tcf.local\Support\TSTemplate\TSWallpaper.bgi")
0
chekfuAuthor Commented:
Hello RobSampson:
I just tried. Sorry to inform that it is still the same.
0
oBdACommented:
There's actually another error in the script; the bgi file is directly concatenated behind the /all, creating the string "/all\\tcf.local\Support\TSTemplate\TSWallpaper.bgi" which bginfo in all likelihood doesn't really like.
Let's do it consequently:
Set objShell = WScript.CreateObject("WScript.Shell") 
'-------- DEFINE THE PROGRAM FILE LOCATION ---------
strExecuteFile = "\\tcf.local\Support\TSTemplate\bginfo.exe"
 
'-------- DEFINE THE CONFIGURATION FILE LOCATION ---------
strConfigurationFile = "\\tcf.local\Support\TSTemplate\TSWallpaper.bgi"
 
'-------- DEFINE THE PROGRAM OPTIONS---------
strExecuteOptions = "/NOLICPROMPT /timer:0"
 
'-------- RUN COMMAND ---------
objShell.Exec strExecuteFile & " " & strConfigurationFile & " " & strExecuteOptions

Open in new window

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
RobSampsonCommented:
Ah, great pick-up!  Yes, maybe that will help.....
chekfu, notice that oBdA has placed an extra space ( & " " & ) in the objShell.Exec line....

Perhaps try that as a StartUp script.....

Regards,

Rob.
0
chekfuAuthor Commented:
Hello RobSampson

Your method works with below amendment done!! Really thanks a lot!!!

objShell.Exec strExecuteFile  & " " & strExecuteOptions & " " & strConfigurationFile

0
chekfuAuthor Commented:
Ooopsss.. really sorry!!

The award point goes to oBdA. Many thanks to oBdA.
0
RobSampsonCommented:
Excellent! No problem. Thanks for your help oBdA.

Regards,

Rob.
0
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.