Link to home
Start Free TrialLog in
Avatar of chekfu
chekfu

asked on

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".
Avatar of RobSampson
RobSampson
Flag of Australia image

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.
Avatar of oBdA
oBdA

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.
Avatar of chekfu

ASKER

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!
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.
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")
Avatar of chekfu

ASKER

Hello RobSampson:
I just tried. Sorry to inform that it is still the same.
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Avatar of chekfu

ASKER

Hello RobSampson

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

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

Avatar of chekfu

ASKER

Ooopsss.. really sorry!!

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

Regards,

Rob.