+ Post New Thread
Results 1 to 6 of 6
Scripts Thread, AutoIt / cmd file in Coding and Web Development; Hello there, Does anyone know how you can get a DOS (batch/cmd) file to hide or produce asterisks for certain ...
  1. #1
    superfletch's Avatar
    Join Date
    Nov 2007
    Location
    South
    Posts
    434
    Thank Post
    146
    Thanked 77 Times in 61 Posts
    Rep Power
    31

    AutoIt / cmd file

    Hello there,

    Does anyone know how you can get a DOS (batch/cmd) file to hide or produce asterisks for certain characters when a user inputs them?

    What I'm doing uses a combination of AutoIt and cmd files. My AutoIt code takes a password from a user (which is asterisked out when they type it into the GUI) and passes it back into a cmd file. I can't find a way to asterisk out the input from AutoIt into the cmd file though.

    I tried using the _RunDos command in AutoIt but I can't tell if the cmd file is working like that as I need to see if the cmd file returns any errors.

    Does anyone know a way I can do this? (Preferably without using third party software).

  2. #2

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    Send your password to the cmd script as a parameter?

  3. Thanks to powdarrmonkey from:

    superfletch (15th August 2008)

  4. #3

    dhicks's Avatar
    Join Date
    Aug 2005
    Location
    Knightsbridge
    Posts
    5,624
    Thank Post
    1,240
    Thanked 778 Times in 675 Posts
    Rep Power
    235
    Quote Originally Posted by superfletch View Post
    My AutoIt code takes a password from a user (which is asterisked out when they type it into the GUI) and passes it back into a cmd file. I can't find a way to asterisk out the input from AutoIt into the cmd file though.
    You mean you're not passing the user's password as a parameter, you're getting AutoIt to "type" it in as input to your batch file? Surely there has to be a better way - can't you make the batch file take a password as a parameter, test it from the command line, then run it from AutoIt when you've got it working? You could also redirect the output of whatever program you're running from your batch file to a log file of some kind (i.e. put > log.txt 2>&1 at the end of the batch file line you use to run whatever command you're using).

    --
    David Hicks

  5. #4
    superfletch's Avatar
    Join Date
    Nov 2007
    Location
    South
    Posts
    434
    Thank Post
    146
    Thanked 77 Times in 61 Posts
    Rep Power
    31
    Thanks folks,

    What it currently does is assign the password as a variable from the AutoIt GUI, then uses send(the variable) to type it into the cmd file.

    What you're saying is to stick with that but get AutoIt to pass the password as a variable into a parameter within the batch file, perhaps using the filewriteline command?

  6. #5

    dhicks's Avatar
    Join Date
    Aug 2005
    Location
    Knightsbridge
    Posts
    5,624
    Thank Post
    1,240
    Thanked 778 Times in 675 Posts
    Rep Power
    235
    Quote Originally Posted by superfletch View Post
    What you're saying is to stick with that but get AutoIt to pass the password as a variable into a parameter within the batch file, perhaps using the filewriteline command?
    I think you just want the _RunDos command, you just need to run the batch file from the command prompt a couple of times to check if it works before running it from AutoIt - either that or redirect the command's output with "> out.log 2>&1".

    It would probably help if you gave us a few more details of what, exactly, you're trying to do.

    --
    David Hicks

  7. Thanks to dhicks from:

    superfletch (19th August 2008)

  8. #6
    superfletch's Avatar
    Join Date
    Nov 2007
    Location
    South
    Posts
    434
    Thank Post
    146
    Thanked 77 Times in 61 Posts
    Rep Power
    31
    Thanks dhicks,

    _RunDos has worked now - It took me quite a while to get it there though, I kept missing bits of my commands. It's also a lot neater than calling the cmd file as I don't have the dirty old Dos window appearing!!

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 5
    Last Post: 29th January 2013, 10:16 AM
  2. cmd command
    By tabby1039 in forum Windows
    Replies: 4
    Last Post: 3rd June 2008, 10:47 AM
  3. AutoIt Script Help - Get Last Changed File
    By russdev in forum Scripts
    Replies: 8
    Last Post: 8th August 2007, 05:34 AM
  4. AutoIT
    By Gatt in forum Scripts
    Replies: 3
    Last Post: 3rd July 2007, 01:29 PM
  5. Replies: 1
    Last Post: 21st January 2007, 02:51 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •