Solved

Run Script / Batch file upon Remote Desktop Logon

Posted on 2013-02-07
6
4,439 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
  • 4
6 Comments
 
LVL 80

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 69

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
ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

 

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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
A safe way to clean winsxs folder from your windows server 2008 R2 editions
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…

820 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