ms access - Execute VBScipt on local machine, triggered from remote desktop - Stack Overflow

时间: 2025-01-06 admin 业界

I have a vbscript on my local machine. It's simple "Hello World!" message box.

msgbox "Hello World!", vbexclamation, "Greetings"

I execute from the local command line or by clicking on it and it works fine.

When I trigger it from my Access vba app on a remote desktop server it runs also, but the message box is displayed on the server not the local machine where the script is. How can I get the script to display the message box on the local machine?

More: My goal is to run some SAP scripting code in a VBS file that interacts with SAP and pulls a report. Problem is, SAP client is not available on the server, but each user has it on their local machine. I am trying to streamline the process by allowing them to trigger the process from the Access app, but run the SAP client commands on the local machine.

Thanks. Keith

I have a vbscript on my local machine. It's simple "Hello World!" message box.

msgbox "Hello World!", vbexclamation, "Greetings"

I execute from the local command line or by clicking on it and it works fine.

When I trigger it from my Access vba app on a remote desktop server it runs also, but the message box is displayed on the server not the local machine where the script is. How can I get the script to display the message box on the local machine?

More: My goal is to run some SAP scripting code in a VBS file that interacts with SAP and pulls a report. Problem is, SAP client is not available on the server, but each user has it on their local machine. I am trying to streamline the process by allowing them to trigger the process from the Access app, but run the SAP client commands on the local machine.

Thanks. Keith

Share Improve this question edited 17 hours ago Andre 27.6k7 gold badges41 silver badges83 bronze badges asked yesterday keith bkeith b 194 bronze badges 4
  • You mean, a script to simulate user input in "SAP GUI for Windows"? – Sandra Rossi Commented 7 hours ago
  • Why not install the SAP client on the remote desktop server, and all your woes are solved here? Some kind of "jinkey" approach where you hope that the RDP client has correct mapping to some local folders that the server can also use? That's not particularly reliable. On the other hand MUCH better would be to create a custom RDP channel. We do that now for outlook. If you running the app local, then we launch outlook with a PDF attachment from Access (we all done that). But, if you running access over RDP, then our custom channel will launch + use local outlook with the PDF attachment. – Albert D. Kallal Commented 5 mins ago
  • Consider a custom RDP channel for this, and as noted, we do that now for outlook, PDF's, and Excel. This not only works seamless, but means we don't have to have any office licenses on the RDP server. Thus simply things like launching a email template in Outlook works regardless if users are on RDP or they are running Access local - either way, we thus have full automation of say Outlook, Word, or whatever. We wrote the custom RDP channel in vb.net. This setup does require a one time .dll to be installed on each client machine, but once done, then we can send commands from server to local PC. – Albert D. Kallal Commented 2 mins ago
  • hence this technology: learn.microsoft.com/en-us/windows/win32/termserv/… – Albert D. Kallal Commented 30 secs ago
Add a comment  | 

1 Answer 1

Reset to default 0

As your terminal server session seems to have access to your local folders, you could let your Access application create a "control" file in a local folder and monitor this event and, when happening, call your script:

Windows (10) Task Scheduler trigger on folder changes