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

Add option to use SFN for ComSpec variable

Discussion in 'Suggestions' started by ebbe, Sep 9, 2008.

  1. ebbe

    Joined:
    Jun 2, 2008
    Messages:
    31
    Likes Received:
    0
    I have TCMD/TCC installed in "C:\Program Files\JPSoft\TCMD9" and so TCC sets the ComSpec variable accordingly:
    set comspec
    C:\ProgramFiles\JPSoft\TCMD9\tcc.exe
    This confuses programs that expect ComSpec to be without spaces as it is when CMD is running:
    set comspec
    ComSpec=C:\WINDOWS\system32\cmd.exe
    I propose an option for TCC where you can tell it to set the ComSpec variable using the short file name (SFN).
     
  2. Rex Clark

    Joined:
    May 30, 2008
    Messages:
    57
    Likes Received:
    0
    Try it with quotes "drive:\path\comspec"
     
  3. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    ebbe wrote:
    | I have TCMD/TCC installed in "C:\Program Files\JPSoft\TCMD9" and so
    | TCC sets the ComSpec variable accordingly:set comspec
    | C:\ProgramFiles\JPSoft\TCMD9\tcc.exe
    |
    | This confuses programs that expect ComSpec to be without spaces as it
    | is when CMD is running:set comspec ComSpec=C:\WINDOWS\system32\cmd.exe
    |
    | I propose an option for TCC where you can tell it to set the ComSpec
    | variable using the short file name (SFN).

    You can do it yourself in your TCSTART.BTM:

    set comspec=%@sfn[%comspec]

    Better yet, do what many others do: make your computer your Personal
    Computer (and not Bill's playground), ignore Microsoft's rules for default
    installation directory, and install JPsoft (and other) products using
    pathnamess without special characters, e.g., C:\JPsoft\TCMD9. If you do this
    when installing the product, all Windows (registry) references will be to
    the simple path.

    Another alternative: create a soft link C:\Programs to "C:\Program Files".
    In WinXP this would have to be a "junction", but in Vista it could be a hard
    link. This effectively creates your own, private SFN for "C:\Program Files".

    Lastly, the method which may be the simplest, but possibly not very pleasing
    one: start TCC using its SFN! Do this by modifying the desktop shortcuts,
    etc.
    --
    HTH, Steve
     
  4. ebbe

    Joined:
    Jun 2, 2008
    Messages:
    31
    Likes Received:
    0
    Yes, and that's the one I'll use since I can implement it without (too much) fuss.

    I'll keep this one in mind when I have to install TCMD on a new PC.

    Interesting idea - but I think I'll go with the simple method (above).

    This one probably works if you start TCC directly. It does not work when starting TCC through Take Command - as I do.
     
  5. ebbe

    Joined:
    Jun 2, 2008
    Messages:
    31
    Likes Received:
    0
    This works only in the cases where I have access to the source code (and permission to change it) for the program that uses the Comspec variable. Unfortunately, this is far from always the case.
     
  6. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    ebbe wrote:
    | ---Quote (Originally by Steve Fábián)---
    | Lastly, the method which may be the simplest, but possibly not very
    | pleasing
    | one: start TCC using its SFN! Do this by modifying the desktop
    | shortcuts,
    | etc.
    | ---End Quote---
    | This one probably works if you start TCC directly. It does not work
    | when starting TCC through Take Command - as I do.

    Start TCMD using its SFN path, and I suspect TCC will use it, too! If you
    use the [TABn] section in TCMD's .INI file to automatically start TCC, you
    can again use the SFN for TCC.EXE.
    --
    Steve
     
  7. K_Meinhard

    Joined:
    May 20, 2008
    Messages:
    310
    Likes Received:
    0
    Steve FXbiXn wrote:


    We just had a thread which showed that TCC returnes "wrong" values when
    started with a SFN path.

    Mit freundlichem Gruß,

    Klaus Meinhard
     
  8. ebbe

    Joined:
    Jun 2, 2008
    Messages:
    31
    Likes Received:
    0
    That was the first thing I tried. Unfortunately, your suspicion is wrong :)

    Actually, i the Tab-tab in TCMD options, you can set the Comspec variable. However, setting the Comspec to the equivalent SFN has a slight sideeffect, namely that when you have your path displayed in the prompt, that path is now shown as a SFN.

    So I ended up biting the bullet and re-installed TCMD in c:\TCMD9. This should also take care of the problem that Klaus mentions.

    Thanks to all who helped out here ;)
     
  9. Rex Clark

    Joined:
    May 30, 2008
    Messages:
    57
    Likes Received:
    0
    | ---Quote (Originally by Rex Clark)---
    | Try it with quotes "drive:\path\comspec"
    | ---End Quote---

    Sorry i wasn't very clear
    manual entry..
    set comspec="c:\long ass windoz\path name\to\simply the best shell
    ever\4nt.exe"
    what ever your prefered jpsoft shell is

    or do as others do ignore default install folder
     

Share This Page