0

For Purpose, I use Pstools to remote the target PC to switch different WIFI profile in a batch file. The code be like:

psexec \\targetPC IP -u account -p password cmd.exe/c netsh.exe wlan add profile ....
#do something(cost about 5 hours to finish)
psexec \\targetPC IP -u account -p password cmd.exe/c netsh.exe wlan delete profile ....

i used to run this script at my pc smoothly & fine. but recently after I finish my testing, i got the error:

Couldn't connect to target PC IP, access is denied.

i have do some several test like:

psexec \\targetPC IP -u account -p password cmd.exe/c netsh.exe wlan add profile ....
timeout 600
psexec \\targetPC IP -u account -p password cmd.exe/c netsh.exe wlan delete profile ....

sometimes work fine, sometimes got access is denied. Is there any suggestion to solve this issue? thanks.

Note: I used to use psexec command to open calc or notepad on target PC, but recently i cannot, is that relate to Administrator or what?

Tomgate
  • 53
  • 1
  • 9

1 Answers1

1

Did you run CMD as administrator? if no, run it as adminstrator. if yes, add this registry key:

reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f

On Windows 7/8/10, UAC is enabled by default and is set to filter a network logon of a local account of their Administrative rights.

ori6151
  • 592
  • 5
  • 11
  • HI, first thank you for your reply and sorry for late response, but i have already add the registry key in my target PC, should i add it in the control pc? – Tomgate Sep 06 '19 at 06:43
  • Try this: [PSEXEC, access denied errors](https://stackoverflow.com/a/14103682/9100289) – ori6151 Sep 06 '19 at 07:15