Solved running CMD from another pc on the LAN

Bert02

New member
I made a cmd file to stop and start a service when it had issues and it worked a treat
i was able to run it from another pc on the same lan no problems

then it just decided to stop working. it wouldn't even work if i ran it from the actual pc unless i ran it as admin (i haven't changed any settings) but it was around that time UAC decided to somehow take over and prompt me for everything and the UAC shield started appearing next to a lot of things. (i have windows check but not install updates) and i haven't installed any updates in that time.

my work around was to remote desktop into that pc and run the cmd as admin then log back out but i'm getting sick of doing a work around for a work around.

i get an error:
Code:
[SC] OpenService FAILED 5:
[SC] StartService: OpenService FAILED 5:

Can anyone tell me
1. how do i disable UAC completely to see if it works?
2. a different way to do it?
3. why it stopped/wont work?



Code:
sc \\**HOSTNAME* stop **SERVICE**
timeout 10
sc \\**HOSTNAME* start **SERVICE**
pause
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom
OS
Windows 7 Ultimate x64
CPU
Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz
Motherboard
ASRock Z77 Extreme4
Memory
16GB 2x F3-1600C10-8GAO
Graphics Card(s)
NVIDIA GeForce GTX 260
Sound Card
onboard
Screen Resolution
1920x1080
Hard Drives
(1) Hitachi HDS721050CLA362
(2) SanDisk SDSSDX240GG25
(3) WDC WD5000AAKS-00TMA0
PSU
Antec Quattro 850W
Hi Bert02,

I just did a quick Google and found some code that you might get an idea from and adapt:

Code:
%windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f

This is the link if you want to investigate further:

Disable UAC via cmd line in batch file

I hope this helps!
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Fujitsu LIFEBOOK
OS
Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
CPU
Intel(R) Pentium(R) CPU P6200 @ 2.13GHz
Motherboard
FUJITSU FJNBB06
Memory
4.00 GB
Graphics Card(s)
Intel(R) Graphics Media Accelerator HD
Sound Card
[1] Realtek High Definition Audio [2] Intel(R) Display Audio
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 59 Hz
Hard Drives
TOSHIBA MK5076GSX
Antivirus
AVG FREE
I have already tried to fix it once and spent hours on it

ended up trying every post that had an answer. finally got this one to work

1. that reg edit you posted works a treat to disable and or enable. but i have to reboot every time. making it pointless trying to add it into my cmd file. I have NFI how UAC had re enabled itself and that i wasn't able to disable it again with the slider i think its best if i keep it enabled after a quick google.

3. yes UAC caused the issue and the regedit i posted allows me to have uac enabled and run the cmd

cheers at least i was able to work out it was UAC causing the issue and fix it.

this Reg key disables the UAC for my said problem and allows the cmd file to work

https://support.microsoft.com/en-us/help/942817/how-to-change-the-remote-uac-localaccounttokenfilterpolicy-registry-se
Code:
Click Start, type regedit in the Start Search box, and then click regedit.exe in the Programs list.
Locate and then click the following registry subkey: 

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system

On the Edit menu, point to New, and then click DWORD Value.

Type LocalAccountTokenFilterPolicy for the name of the DWORD, and then press ENTER.

Right-click LocalAccountTokenFilterPolicy, and then click Modify.

In the Value data box, type 1, and then click OK.

Exit Registry Editor.
 
Last edited:

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom
OS
Windows 7 Ultimate x64
CPU
Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz
Motherboard
ASRock Z77 Extreme4
Memory
16GB 2x F3-1600C10-8GAO
Graphics Card(s)
NVIDIA GeForce GTX 260
Sound Card
onboard
Screen Resolution
1920x1080
Hard Drives
(1) Hitachi HDS721050CLA362
(2) SanDisk SDSSDX240GG25
(3) WDC WD5000AAKS-00TMA0
PSU
Antec Quattro 850W
Cheers, at least I was able to work out it was UAC causing the issue and fix it.

You're welcome Bert02, I am sorry I couldn't be of more help!
I am sure that someone will be able come up with a non-restart solution for you.
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Fujitsu LIFEBOOK
OS
Win 7 HP SP1 64-bit Vista HB SP2 32-bit Linux Mint 18.3
CPU
Intel(R) Pentium(R) CPU P6200 @ 2.13GHz
Motherboard
FUJITSU FJNBB06
Memory
4.00 GB
Graphics Card(s)
Intel(R) Graphics Media Accelerator HD
Sound Card
[1] Realtek High Definition Audio [2] Intel(R) Display Audio
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 59 Hz
Hard Drives
TOSHIBA MK5076GSX
Antivirus
AVG FREE
Back
Top