The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    how to make subst command work in a batch file?

    Discussion in 'Windows OS and Software' started by entropy.cz, Nov 3, 2008.

  1. entropy.cz

    entropy.cz Notebook Evangelist

    Reputations:
    110
    Messages:
    386
    Likes Received:
    0
    Trophy Points:
    30
    hi,

    i want to map a directory (d:\Data) as a virtual drive (h: ), and when i run this in commandline, the drive is created till the reboot:

    subst h: d:\Data

    BUT, when i create a subst.bat file (so that i could add it to the startup list, so that the drive won't get lost with the reboot), the command wil start "cycling" and won't be launched properly. if you won't add the @echo off line, you can see the command cycling again and again, without being executed actually...

    what am i doing wrong, what should be the exact syntax of the batch file, so that it *would* work?

    i'm running win xp sp3.

    thanks for the hints in advance! :)
     
  2. ATG

    ATG 2x4 Super Moderator

    Reputations:
    3,306
    Messages:
    4,461
    Likes Received:
    344
    Trophy Points:
    151
    What exactly do you mean by "cycling"?

    Do you have any other commands before subst in your subst.bat? If this is meant to be included on a startup cd/floppy do you have LASTDRIVE defined in your config.sys?
     
  3. swarmer

    swarmer beep beep

    Reputations:
    2,071
    Messages:
    5,234
    Likes Received:
    0
    Trophy Points:
    205
    It's interpreting your "subst" command (in the batch file) to mean to run the batch file subst.bat again (recursively) instead of running the built-in subst command.

    To fix, just rename the batch file to anything else.
     
  4. ATG

    ATG 2x4 Super Moderator

    Reputations:
    3,306
    Messages:
    4,461
    Likes Received:
    344
    Trophy Points:
    151
    Yeah you're right...Stupid me didn't think about that and I wrote them side to side in my previous post...
    That's it I'm off to bed!
     
  5. entropy.cz

    entropy.cz Notebook Evangelist

    Reputations:
    110
    Messages:
    386
    Likes Received:
    0
    Trophy Points:
    30
    um... geez, if it's true, i'm thankful to you till the end of my life!! :cool: (gonna try that)

    edit: yes, it worked. i never thought that a filename could cause troubles :) thanks!