
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2018 09:54 AM
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?
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?
Labels:
- Labels:
-
General Discussion
3 REPLIES 3

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2018 03:01 PM
Thanks for the response, ill give your suggestion a try.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2018 02:44 PM
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:
- Place the .bat script in the packageshare.
- Run the deployment with the script (not the command).
- Execute the deployment package in the "Currently Logged On" Run mode.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2018 08:16 AM
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:
- Place the .bat script in the packageshare.
- Run the deployment with the script (not the command).
- Execute the deployment package in the "Currently Logged On" Run mode.
