Question VBA command at Admin level (1 Viewer)

ukaquanaut

Registered User.
Local time
Yesterday, 20:33
Joined
Feb 8, 2012
Messages
33
Hi Guys

I have built an Access app that uses Bartender to print labels.

Bartender requires some windows processes to be running. I have been able to read the status of the processes and run commands to stop/start the required windows services. However, this running the app in Administrator mode with a full development software.

When I transfer this app to the PC that will run it on the runtime system, the check for the service works but it wont start the services because it has no Administrator rights.

I tried to change the compatibility settings for Administrator on the run time shell in the Office folder but it fails to run any databases then.

I'm after either a way to elevate the permission in the code temporarily or to run the whole app in runtime mode as administrator. I would prefer the former.

I been surfing the web for hours and can't really see a good solution. Your assistance would be appreciated please

Jerry
 

ukaquanaut

Registered User.
Local time
Yesterday, 20:33
Joined
Feb 8, 2012
Messages
33
Hiya

yes I have seen them the problem I have is that controlling windows services isn't running a program like an .exe. its VBA

For Each svc In GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") _
.ExecQuery("SELECT * FROM Win32_Service WHERE Name='" service & "'")
svc.StartService
Exit For
Next

I'm not sure how that would work

Jerry
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 11:33
Joined
May 7, 2009
Messages
19,233
hoe about the windows NET command:

net servicename /start
 

jdraw

Super Moderator
Staff member
Local time
Yesterday, 23:33
Joined
Jan 23, 2006
Messages
15,378
Untried/untested, but this link may have useful info(using Powershell).
 

Users who are viewing this thread

Top Bottom