?
Solved

Run Script / Batch file upon Remote Desktop Logon

Posted on 2013-02-07
6
Medium Priority
?
4,766 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 82

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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

A safe way to clean winsxs folder from your windows server 2008 R2 editions
Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
Suggested Courses

752 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