Solved

Run Script / Batch file upon Remote Desktop Logon

Posted on 2013-02-07
6
4,207 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 78

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 68

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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Remote Desktop Connections allow you to control remote host machines via the magic of the Internet and RDP (Remote Desktop Protocol). For the purposes of this article we will assume you are connecting from your home PC or laptop to a remote offic…
In this article, I'll explain how to setup a Plex Media Server (https://plex.tv/) on a Redhat (Centos) 7 based NAS with screenshots to help those looking for assistance.  What is Plex? If you aren't familiar with Plex, it’s a DLNA media serv…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now