locked
CMDKEY script no password prompt RRS feed

  • General discussion

  • Here is a script I'm using to store the credentials for server shares:

    @echo off

    cd C:\Windows\System32

    cmdkey /add:PrintServer /user:demo\%username% /password:%pw%

    Now, if I'm running the command from a prompt live, then it works just great without prompting for the password that I'm using. But I want to take it a step further. I want this command in a batch file to run at log on for the end users and NOT prompt them for the password, but store the credentials successfully in the credentials manager without any user intervention.

    Users are running in Win7, on a SUSE environment with ZenWorks, pushing out logons with KBOX. Regardless, it can be replicated by using workgroup mode in Windows.

    So how can I use cmdkey with a batch file at logon without a password prompt?


    • Edited by Aquintasii Tuesday, December 23, 2014 1:32 PM
    • Changed type Bill_Stewart Friday, January 30, 2015 5:55 PM
    • Moved by Bill_Stewart Friday, January 30, 2015 5:55 PM Abandoned
    Tuesday, December 23, 2014 3:05 AM

All replies

  • Sorry but this is a scripting forum.  It is not a utilites support forum.  In any case what you are trying to do cannot be done.


    ¯\_(ツ)_/¯

    Tuesday, December 23, 2014 5:12 AM
  • If I can do this in a command line, I should be able to in as a batch file, right?
    Tuesday, December 23, 2014 1:23 PM
  • If I can do this in a command line, I should be able to in as a batch file, right?

    Sorry - post in WIndows 7 forum for assistance on how to use the CMDKEY utility.


    ¯\_(ツ)_/¯

    Tuesday, December 23, 2014 1:35 PM
  • This wouldn't be recommended anyway, because then you would have a shell script (batch file) with a plain-text password embedded within it, which is a bad idea for obvious reasons.

    -- Bill Stewart [Bill_Stewart]

    Tuesday, December 23, 2014 3:23 PM
  • This wouldn't be recommended anyway, because then you would have a shell script (batch file) with a plain-text password embedded within it, which is a bad idea for obvious reasons.

    -- Bill Stewart [Bill_Stewart]

    I realize that. Still need an alternative process then, I can't believe I'm not getting an answer other than no. I'll take this elsewhere. Thanks for the "help".
    Tuesday, December 23, 2014 4:45 PM
  • What's provoking the question, then? Perhaps you're actually asking the wrong question.

    -- Bill Stewart [Bill_Stewart]

    Tuesday, December 23, 2014 5:57 PM