1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Speaking The Current Directory

Discussion in 'T&T - Aliases' started by Joe Caverly, Sep 22, 2010.

  1. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    680
    Likes Received:
    8
    Here's a little alias that allows the computer to speak the current directory that you are in, after you change to that directory;

    Code:
    alias cds=`*cd %1 & set cwd=%_cwd & nircmd speak text ~$sys.cwd$ & unset cwd`
    This requires the NIRCMD.EXE, available from http://www.nirsoft.net/utils/nircmd.html

    Note that if you just type
    Code:
    cds
    it will speak the current directory that you are in, without changing the directory.

    This was tested in TCC 12, Windows XP Build 2600 Service Pack 3. You will need to have Microsoft Speech installed.

    If you have Microsoft Speech installed, you can change the voice that is speaking.

    Go into Control Panel, and double-click the Speech Icon.

    In the Speech Properties Dialog, click the Text To Speech tab.

    On my system, I have three voices;

    LH Michael
    LH Michelle
    Microsoft Sam

    You can also adjust the voice speed from here.

    Joe
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,300
    Likes Received:
    39
    You don't actually need to force the value into an environment variable. You can pass %_CWD on the command line, and it will be expanded before the external program sees it:

    Code:
    alias cds=`*cd %1 & nircmd speak text %_cwd`
    
     
  3. Kachupp

    Joined:
    Aug 9, 2009
    Messages:
    133
    Likes Received:
    0
  4. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    680
    Likes Received:
    8
    NirCmd may display as a virus, spyware, or potentially unwanted program on some anti-virus and anti-spyware programs because certain viruses and spyware include and use NirCmd to perform actions on the users PC. However it is also used by many good programs as well, and by itself it poses no risk.

    I have been using this program since 2008 on several systems. F-Prot anti-virus and Microsoft Security Essentials do not see it as a virus on my system.

    Visit http://www.nirsoft.net/faq.html and review the second Question in the list.

    Joe
     

Share This Page