viewpoint-particle

Author Topic: wntAddDrive & save credentials  (Read 79 times)

domvalle@comcast.net

  • Newbie
  • *
  • Posts: 13
wntAddDrive & save credentials
« on: November 05, 2019, 12:22:34 pm »
When using wntAddDrive and persist: @TRUE, the password is not remembered after a logoff.
Is there any way to force this?
We are using Win 10 Pro and Winbatch 2019B.
thanks!

td

  • Tech Support
  • *****
  • Posts: 3079
    • WinBatch
Re: wntAddDrive & save credentials
« Reply #1 on: November 05, 2019, 01:19:16 pm »
Assuming you are referring to the credentials used to access the share you have mapped to a drive, you need to save the credentials in Windows 10's Credential Manager.  You can do this manually via an applet UI.  See the following for an easy way to access the applet on Windows 10.

https://support.microsoft.com/en-ca/help/4026814/windows-accessing-credential-manager

I know you can access the credential manager's cache of user names and passwords using dotNet or WMI.  However, I don't remember if you can add credentials.  I look into it and report back if I find something.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

  • Tech Support
  • *****
  • Posts: 3079
    • WinBatch
Re: wntAddDrive & save credentials
« Reply #2 on: November 05, 2019, 02:20:27 pm »
There is always the cmdkey.exe utility that allows you to add or remove credentials from the Windows "vault".  Type "cmdkey.exe /?" from a command prompt to see usage.

There is a Powershell module for the credential manager around someplace but I am not sure that it is still supported.  I image it was just a cover for the Win32 Credential Manager API.  -  The API might make a good WIL extender.

Still think there might be a scripting solution but can't seem to come up with one at the moment.  Maybe some else has an idea.

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

domvalle@comcast.net

  • Newbie
  • *
  • Posts: 13
Re: wntAddDrive & save credentials
« Reply #3 on: November 06, 2019, 10:27:23 am »
Actually  cmdkey.exe worked great!
used with the doscapture extender, nice!
thanks!

td

  • Tech Support
  • *****
  • Posts: 3079
    • WinBatch
Re: wntAddDrive & save credentials
« Reply #4 on: November 06, 2019, 01:19:43 pm »
Some users prefer not to spin up a child process by running a command shell application but if that is not an issue for you,  you have your solution.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

  • Tech Support
  • *****
  • Posts: 3079
    • WinBatch
Re: wntAddDrive & save credentials
« Reply #5 on: November 06, 2019, 02:26:07 pm »
There are several ways to capture a command shell window's output without using an extender documented in the Tech Database.  Here is a link to one of them

https://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/DOS+Capture~DOS~Window~output.txt
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade