RUNSHELL AND ADMINISTRATORS

This forum is for ideas and or code to be contributed for general use.
Post Reply
Message
Author
User avatar
slobodan1949
Posts: 81
Joined: Mon Apr 25, 2011 8:57 am
Location: SERBIA
Contact:

RUNSHELL AND ADMINISTRATORS

#1 Post by slobodan1949 »

Xbase++

RUNSHELL() COMMAND AND ADMINISTRATOR AUTHORIZATIONS

Notes:
The RunShell() command is becoming more and more relevant for working
with the program CURL.EXE (which is now an integral part of windows)
and other similar tools for the development and use of electronic XML
and JSON documents via HTTP and RESTFUL WEB SERVICES (electronic
invoices and fiscal accounts and the like)
---------------------------------------------------------------------------
Part 1
If the external program SHARED.EXE (Autoit) or SHARED.EXE (Xbase++)
requires administrator rights to start
so that program is started from the Xbase++ application TEST.EXE with
RunShell("","SHARED.EXE")
SHARED.EXE will not start because it requires administrator rights
and the Xbase++ application TEST.EXE will report an error and terminate.
The program SHARED.EXE will start only in the case when TEST.EXE
starts as administrator

If the TEST.EXE command is used in the Xbase++ application
RunShell("/C SHARED.EXE",,.F.,.T.)
The SHARED.EXE program will also start if the TEST.EXE application
not started as administrator
---------------------------------------------------------------------------
Part 2
If the Xbase++ application TEST.EXE is located in the C:\PRG folder
and works on the database workspace:
SET PATH "C:\PRG\DATA"
CURDIR("C:\PRG\DATA")
then the SHARED.EXE program must be located in the C:\PRG folder
and must be started as follows:
curdir("C\PRG")
RunShell("/C SHARED.EXE",,.F.,.T.)
curdir("C:\PRG\DATA")
---------------------------------------------------------------------------
Part 3
The SHARED.EXE program can also be started from the Xbase++ application
via command lines: SHARED.CMD
curdir("C\PRG")
RunShell("/C SHARED.CMD",,.F.,.T.)
curdir("C:\PRG\DATA")
The SHARED.CMD file has only one line that reads: SHARED.EXE
The files TEST.EXE, SHARED.EXE and SHARED.CMD must be present
in the same folder - in this example in the C:\PRG folder

User avatar
Tom
Posts: 1184
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: RUNSHELL AND ADMINISTRATORS

#2 Post by Tom »

We only use CURL for testing with RestFul APIs. We use the Chilkat Library in our applications, and the Chilkat Online Tools to get FoxPro code directly from Postman collections and Swagger APIs (which is easy to convert to Xbase++). Using the Chilkat functionalities gives the control about the process and it's results which is needed for most of the services used with REST. I personally wouldn't deliver anything that depends on programs spawned by RunShell().
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4737
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: RUNSHELL AND ADMINISTRATORS

#3 Post by rdonnay »

I personally wouldn't deliver anything that depends on programs spawned by RunShell().
I wouldn't do so either.

I use httpClient for REST services.
The eXpress train is coming - and it has more cars.

Post Reply