Does anyone know how to run a .cmd script from VA Smalltalk with admin privileges?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Does anyone know how to run a .cmd script from VA Smalltalk with admin privileges?

Louis LaBrunda
Hi All,

Does anyone know how to run a .cmd script from VA Smalltalk with admin privileges?  I know how to run command files but I need to run one with privileges.  I expect there is some structure I need to fill in and I'm looking but I will gladly take some help.

Lou

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Does anyone know how to run a .cmd script from VA Smalltalk with admin privileges?

Noschvie
Hi Louis
try to logon as administrator using an OSCall, run the script and logoff / "revert to self".
We use this to start / stop / restart a Windows service like SNMP

OSCall>>#logonUser:lpszDomain:lpszPassword:dwLogonType:dwLogonProvider:phToken:
    "LOGON32_PROVIDER_WINNT50 = 3
     LOGON32_LOGON_NEW_CREDENTIALS = 9"

OSCall>>#revertToSelf

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Does anyone know how to run a .cmd script from VA Smalltalk with admin privileges?

Louis LaBrunda
Hi Norbert,

Thanks for the post and sorry for the noise.  The service had admin privileges and they flowed down to the command file.  The problem had nothing to do with privileges, it just looked that way.

Lou

On Monday, October 22, 2018 at 10:54:17 AM UTC-4, Norbert Schlemmer wrote:
Hi Louis
try to logon as administrator using an OSCall, run the script and logoff / "revert to self".
We use this to start / stop / restart a Windows service like SNMP

OSCall>>#logonUser:lpszDomain:lpszPassword:dwLogonType:dwLogonProvider:phToken:
    "LOGON32_PROVIDER_WINNT50 = 3
     LOGON32_LOGON_NEW_CREDENTIALS = 9"

OSCall>>#revertToSelf

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Does anyone know how to run a .cmd script from VA Smalltalk with admin privileges?

Ralf
the simplest way could be

OSHwnd getActiveWindow
shellExecute: 'runas'
lpFile: 'cmd.exe'
lpParameters: nil
lpDirectory: nil
nShowCmd: PlatformConstants::SwShownormal

but, ask google about shellexecute and shellexecuteex. A link to a solution for another lang: https://stackoverflow.com/questions/15319158/use-shell-execute-to-run-cmd-as-admin

No guarantee.:)

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.