cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mjbliss
Engaged Sweeper II
Im attempting to run a cmd via Lansweeper deployment to clear the creds stored in credential manager. Lansweeper reports the CMD executed successfully but the creds dont get cleared.

Running the same cmds via a bat file locally works as expected.

This is the cmd im trying to run:

@echo off
cmdkey.exe /list > "%TEMP%\List.txt"
findstr.exe Target "%TEMP%\List.txt" > "%TEMP%\tokensonly.txt"
FOR /F "tokens=1,2 delims= " %%G IN (%TEMP%\tokensonly.txt) DO cmdkey.exe /delete:%%H
del "%TEMP%\List.txt" /s /f /q
del "%TEMP%\tokensonly.txt" /s /f /q
echo All done

Any ideas where im going wrong?
3 REPLIES 3
mjbliss
Engaged Sweeper II
Thanks for the response, ill give your suggestion a try.
Esben_D
Lansweeper Employee
Lansweeper Employee
I did some quick tests on my hyperv and I'm getting similar results. However, I was able to get it working by doing the following:
  1. Place the .bat script in the packageshare.
  2. Run the deployment with the script (not the command).
  3. Execute the deployment package in the "Currently Logged On" Run mode.
mjbliss
Engaged Sweeper II
Hi Charles, thanks, your suggestion worked a treat!

Charles.X wrote:
I did some quick tests on my hyperv and I'm getting similar results. However, I was able to get it working by doing the following:
  1. Place the .bat script in the packageshare.
  2. Run the deployment with the script (not the command).
  3. Execute the deployment package in the "Currently Logged On" Run mode.