July 22, 2017 executeShell not working | ||||
---|---|---|---|---|
| ||||
auto sss = "sc config \""~szSvcName~"\" start= disabled"; executeShell("sc config \""~szSvcName~"\" start= disabled"); but if I copy and paste the string in to an admin console, it works fine: sc config "W32Time" start= disabled [SC] ChangeServiceConfig SUCCESS szSvcName is W32Time. It's not an admin issue. I *can't* set it to other states either. Does executeShell not run it's process with the same rights as the app? |
July 22, 2017 Re: executeShell not working | ||||
---|---|---|---|---|
| ||||
Posted in reply to FoxyBrown | On Saturday, 22 July 2017 at 02:31:45 UTC, FoxyBrown wrote: > auto sss = "sc config \""~szSvcName~"\" start= disabled"; > executeShell("sc config \""~szSvcName~"\" start= disabled"); > > but if I copy and paste the string in to an admin console, it works fine: > > sc config "W32Time" start= disabled > [SC] ChangeServiceConfig SUCCESS > > szSvcName is W32Time. > > It's not an admin issue. > > I *can't* set it to other states either. Does executeShell not run it's process with the same rights as the app? even spawnProcess isn't doing it spawnProcess(["C:\\Windows\\System32\\sc.exe","config", szSvcName, "start=","disabled"]); or spawnProcess(["C:\\Windows\\System32\\sc.exe","config "~szSvcName~" start= disabled"]); |
Copyright © 1999-2021 by the D Language Foundation