Solved

Run Script / Batch file upon Remote Desktop Logon

Posted on 2013-02-07
6
4,644 Views
Last Modified: 2013-02-13
Hi
I am having some issues on running scripts upon initial logon for remote desktop users when connecting to a windows 2008r2 server.
I run an application on there and most users connect using remote app, however this does not work on one or 2 users due to a problem in the software (so this is a software vendor issue) but lets not worry about that.
What I want is to be able to connect via remote desktop and for the software to run directly on the server (almost the same as remote app)
Before, I used to use a script in the Remote Desktop Connection saved file under programs and run the following:

Program path and file name:
wscript "c:\Scripts\S1.vbs"
Start in the following folder:
c:\scripts

This would then run the file S1.vbs, which is as below:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "C:\Scripts\S1.bat", 0

Which runs the following batch file:

@echo off
c:
cd\
cd "c:\program files (x86)\S1 Manager"
SManager.exe
logoff

Now, I am sure it is something to do with the local security policy on the server, I get the following error message:

Error
Access is denied.
The initial program cannot be started:
C:\windows\system32\wscript.exe “c:\scripts\s1.vbs”
Please consult help for more information.

it will not let the script call the execute file remotley. I cannot do this with a standard user or domain admin
0
Comment
Question by:RPUKsupport
[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
  • 4
6 Comments
 
LVL 81

Expert Comment

by:David Johnson, CD, MVP
ID: 38866506
why not just run 's1.bat' ????
0
 

Author Comment

by:RPUKsupport
ID: 38867283
I tried to run just the bat as you said but still get an error.

Error
Access is denied.
The initial program cannot be started: c:\scripts\s1.bat
Please consult help for more information.
0
 
LVL 70

Expert Comment

by:Qlemo
ID: 38867301
Did you make sure the C:\Scripts folder and its contents is accessible for all users, including SYSTEM and such?
0
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

 

Author Comment

by:RPUKsupport
ID: 38867359
yes all credentials are correct, full access to system and domain admins and read only for SManager users. The folder is accessible from the server itself ok and runs on the server ok once your logged in. I want it to run automatically though.
0
 

Accepted Solution

by:
RPUKsupport earned 0 total points
ID: 38867936
I have found out how to do this.
All I did was to add the bat file, the vbs script and wscript.exe to remote applications in remoteapp manager and it all works ok
0
 

Author Closing Comment

by:RPUKsupport
ID: 38883767
it took lots of trouble shooting but this is how i have done it
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…

690 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