locked
Masking password through cmd file RRS feed

  • Question

  • In Windows server 2008, how do I mask password through a cmd file.
     
    Below code is working in 32 bit 
    -------------------------------------------------------
    @echo off
    set local
    set var=%temp%\hide.com
     
    echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5>%var%
     
    set /p password=Enter password: <nul
    for /f "tokens=*" %%i in ('%var%') do set password=%%i
    echo Your Input: %password%
    del %var%
    echo done
    -------------------------------------------------------
     
    In win64 its saying hide.com is not compatible with windows 64 bit. Can you please suggest a better solution.
    Tuesday, January 24, 2012 8:03 AM

Answers

  • Not necessarily. On my 64-bit machine, these native .com programs exist and work very nicely:

    chcp.com
    diskcomp.com
    diskcopy.com
    format.com
    mode.com
    more.com
    tree.com

    That's because they're actually .exe files. .com files do not run on x64 Windows.

    To answer the OP's question, he can use my editv64.exe utility and use the -m (mask password) option.

    Bill

    Tuesday, January 24, 2012 3:51 PM

All replies

  • Run the batch as a 32 bit program.

     


    jv
    Tuesday, January 24, 2012 9:23 AM
    1. Create VBscript to ask for credentials See: http://www.nilpo.com/2008/07/windows-scripting/masking-passwords-in-windows-scripts/
    2. Start your Dos Batch with Creditials as Arguments from VB Script

    To run 32Bit CMD see: http://www.tipandtrick.net/2008/how-to-open-and-run-32-bit-command-prompt-in-64-bit-x64-windows/

    1. test in Batch if its run 64Bit
    2. If tis run 64Bit, self rerun batch witch %windir%\SysWoW64\cmd.exe 


    Please click “Mark as Answer” on the post that helps you. Thank you ;-)) Bitte markiere hilfreiche Beiträge von mir als "Hilfreich" und Beiträge die deine Frage ganz oder teilweise beantwortet haben als "Antwort". Das wäre Nett :-))
    Tuesday, January 24, 2012 9:29 AM
  • Run the batch as a 32 bit program.

     


    jv
    It's not easy to run a 16-bit program in 32-bit mode on a 64-bit machine . . .
    Tuesday, January 24, 2012 9:45 AM
  • Run the batch as a 32 bit program.

     


    jv
    It's not easy to run a 16-bit program in 32-bit mode on a 64-bit machine . . .

    Right - a com would naturally be a 16 bit program and would likley not run.
    jv
    Tuesday, January 24, 2012 10:44 AM
  • Thank you for the input

     

    I tried running vbscript in 64 bit http://www.nilpo.com/2008/07/windows-scripting/masking-passwords-in-windows-scripts/. This requires ScriptPW.dll which is not available in win64.

     


    Tuesday, January 24, 2012 11:39 AM
  • Right - a com would naturally be a 16 bit program and would likley not run.
    jv

    Not necessarily. On my 64-bit machine, these native .com programs exist and work very nicely:

    chcp.com
    diskcomp.com
    diskcopy.com
    format.com
    mode.com
    more.com
    tree.com

    However, their structure is similar to .exe files:

    00000 4D 5A 90 00 03 00 00 00-04 00 00 00 FF FF 00 00  MZ··········ÿÿ··
    00010 B8 00 00 00 00 00 00 00-40 00 00 00 00 00 00 00  ¸·······@·······
    00020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ················
    00030 00 00 00 00 00 00 00 00-00 00 00 00 F0 00 00 00  ············ð···
    00040 0E 1F BA 0E 00 B4 09 CD-21 B8 01 4C CD 21 54 68  ··º··´·Í!¸·LÍ!Th
    00050 69 73 20 70 72 6F 67 72-61 6D 20 63 61 6E 6E 6F  is program canno
    00060 74 20 62 65 20 72 75 6E-20 69 6E 20 44 4F 53 20  t be run in DOS
    00070 6D 6F 64 65 2E 0D 0D 0A-24 00 00 00 00 00 00 00  mode.¶¶£$·······

    Tuesday, January 24, 2012 11:43 AM
  • Not necessarily. On my 64-bit machine, these native .com programs exist and work very nicely:

    chcp.com
    diskcomp.com
    diskcopy.com
    format.com
    mode.com
    more.com
    tree.com

    That's because they're actually .exe files. .com files do not run on x64 Windows.

    To answer the OP's question, he can use my editv64.exe utility and use the -m (mask password) option.

    Bill

    Tuesday, January 24, 2012 3:51 PM
  • That's because they're actually .exe files. .com files do not run on x64 Windows.

    To answer the OP's question, he can use my editv64.exe utility and use the -m (mask password) option.

    Bill

    Agreed -it's obvious when you look at the file structure.

    Nice collection of tools in edit64.exe. It has the richness of features that we never got in 34 years of MS operating systems. We did not even get them in VB Script without going through some contortions.

    Tuesday, January 24, 2012 4:41 PM
  • Nice collection of tools in edit64.exe. It has the richness of features that we never got in 34 years of MS operating systems. We did not even get them in VB Script without going through some contortions.

    Thanks. One of the cool parts about that project was that there was a minimal amount of effort involved to recompile the code on the x64 platform. It just worked. I think this is a great testimony to Microsoft's compatibility efforts.

    Bill

    Tuesday, January 24, 2012 5:34 PM
  • That's because they're actually .exe files. .com files do not run on x64 Windows.

    To answer the OP's question, he can use my editv64.exe utility and use the -m (mask password) option.

    Bill

    Agreed -it's obvious when you look at the file structure.

    Nice collection of tools in edit64.exe. It has the richness of features that we never got in 34 years of MS operating systems. We did not even get them in VB Script without going through some contortions.


    They are all EXE files named with a COM extension.  Bot system32 and SysWow64 have copies of these files.

    On WS2008 the files are still 16 bit on the 32 bit architecture.  On WS2008R2 they have all been upgraded.

    No utilities with a COM extension deliveredon any other OS will run on WS2008R2.

     


    jv
    Tuesday, January 24, 2012 6:58 PM