Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: white spaces in path while using start command  (Read 10256 times)

0 Members and 1 Guest are viewing this topic.

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: white spaces in path while using start command
« Reply #15 on: December 07, 2009, 02:23:06 PM »
his %TM% variable was set to a folder name.
therefore

Code: [Select]
start "" "C:\fold1\fold2\%TM%"

is what he wants.
I was trying to dereference Null Pointers before it was cool.

Salmon Trout

  • Guest
Re: white spaces in path while using start command
« Reply #16 on: December 07, 2009, 02:36:20 PM »
Here we go again...


billrich



    Rookie

    Thanked: 1
    Re: white spaces in path while using start command
    « Reply #17 on: December 07, 2009, 05:12:50 PM »
    Quote from: BC_Programmer link=topic=he never tried %TM%.
    [/quote

    start "" "C:\fold1\fold2\%TM%"


    C:>start "" "C:batch\fold1\fold2\%TM%"
    The system cannot find the file
    C:\fold1\fold2\C:\batch\fold1\fold2\.




    C:\batch>type gpl2.bat
    Code: [Select]
    @echo off

    set TM="C:\fold1\fold2\"

    echo TM=%TM%

    start "" "%TM%"
    pause

    start "" "C:\fold1\fold2\%TM%"


    pause

    start "%TM%"

    pause
    C:\batch>

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: white spaces in path while using start command
    « Reply #18 on: December 07, 2009, 05:30:03 PM »
    refer to the original post. The assumption being made is that, although the great Billrich doesn't have this particular folder on his drive, the OP, who defined the criteria upon which everybody (aside from the great Billrich, of course) is making suggestions. the fact that the OP says:

    Quote
    set TM="Ticket Folder"

    start C:\fold1\fold2\TM
    cannot find TM

    start C:\fold1\fold2\%TM
    cannot find TM

    start C:\fold1\fold2\%%TM
    cannot find %TM

    basically means that these folders do not actually exist on their machine either, and rather they are providing this code as an example of what they need, which they expressed earlier.

    There are in fact two issues the OP was having; one was the use of quotes around the folder name, which Salmon Trout explained requires a set of "" to define no title before the quotes around the actual folder name. The folder name itself, as presented by the OP above, is acquired by a path (not necessarily C:\fold1\fold2, but rather that is being used as an alias for the actual folder name and to indicate to those of us with cognitive capabilites that they intend to use this sort of command on folders in the heirarchy) which is built using the TM environment variable. the TM variable is, in his above example, being set to "Ticket Folder" this in and of itself presents another issue; the proper assignment should be, as Helpmeh, another PWWPA (Post Who Was Paying Attention) pointed out, without quotes. Instead, the final command should be
    Code: [Select]
    set TM=Ticket Folder
    start "" "C:\fold1\fold2\%TM%"

    Now, to clarify again; the folders will probably not exist on anybody elses machine, and in fact since they are simply abstractions of the actual problem and not true folder names on the OP's machine they probably don't exist there. This of course makes it difficult to locate such abstractions on ones PC, especially when you set the variable to the wrong value. But not to worry, the concept is simple to explain.

    When the OP specified Fold1\fold2\ etc, they are not in fact, speaking of actual folders by this name, but rather they are explaining that they will work with multiple folder names- or more precisely, that the actual names of the folders aren't important. The important point is explained earlier in the post, which is that they are having issues with the start command and using quotes. The examples given also suggest that they have not yet had experience using Environment variables, which, unlike loop variables on the command line (one percent sign preceding) or loop variables in a batch file (two percent signs preceding) require a percent sign on either side of the variable name. Again, having the proper data in the variable is of the utmost importance, and setting it to some arbitrary value is hardly the best way to test the method, especially when the setting given my the OP clearly indicates it is used to specify a single folder name within a folder hierarchy.

    Considering the length of this post, I can make the apt prediction that by ignoring much if it you'll be able to continue to post your illogic and additionally make comments about how unnecessary the girth of my post was. The fact is your understanding of the concepts involved is the issue, not the length of my post, and your complete avoidance of that issue is what prevents you from learning these new things as they are presented to you, a statement made on several occasions my multiple users.
    I was trying to dereference Null Pointers before it was cool.

    Salmon Trout

    • Guest
    Re: white spaces in path while using start command
    « Reply #19 on: December 08, 2009, 12:21:44 AM »
    Paraphrasing slightly for the new folks: billrich is a twice banned very stupid troll who keeps coming back to ruin threads with his trash.

    Helpmeh



      Guru

    • Roar.
    • Thanked: 123
      • Yes
      • Yes
    • Computer: Specs
    • Experience: Familiar
    • OS: Windows 8
    Re: white spaces in path while using start command
    « Reply #20 on: December 08, 2009, 03:13:02 PM »
    Paraphrasing slightly for the new folks: billrich is a twice banned very stupid troll who keeps coming back to ruin threads with his trash.

    Twice?!
    Where's MagicSpeed?
    Quote from: 'matt'
    He's playing a game called IRL. Great graphics, *censored* gameplay.

    Salmon Trout

    • Guest
    Re: white spaces in path while using start command
    « Reply #21 on: December 08, 2009, 03:16:54 PM »
    Twice?!

    I though he must have been banned as JaneDoe or whatever he was calling himself. [Opens new tab) Joanlong I mean.

    billrich



      Rookie

      Thanked: 1
      Re: white spaces in path while using start command
      « Reply #22 on: December 08, 2009, 03:32:56 PM »
      I'm trying to make a startup process at work.  I need it to open several programs in a certain order.  The problem I keep running into is white spaces in the directories or the folders I need opened.

      start C:\folder1\folder2\Folder To Be Opened


      Grimbear,

      How did you solve the problem of not finding the TM variable and/or folder?

      Salmon Trout

      • Guest
      Re: white spaces in path while using start command
      « Reply #23 on: December 08, 2009, 03:34:43 PM »
      trollboy still doesn't get it.

      Salmon Trout

      • Guest
      Re: white spaces in path while using start command
      « Reply #24 on: December 09, 2009, 05:26:51 AM »
      I though he must have been banned as JaneDoe or whatever he was calling himself. [Opens new tab) Joanlong I mean.


      he was also banned as Miketaylor after he sent me a sick (very sick) PM

      billrich



        Rookie

        Thanked: 1
        Re: white spaces in path while using start command
        « Reply #25 on: December 09, 2009, 09:38:18 AM »

        Where is Grimbear?



        Grimbear,

        How did you solve the problem of not finding the TM variable and/or folder?

        Salmon Trout

        • Guest
        Re: white spaces in path while using start command
        « Reply #26 on: December 09, 2009, 09:47:45 AM »
        He's completely crazy.

        billrich



          Rookie

          Thanked: 1
          Re: white spaces in path while using start command
          « Reply #27 on: December 09, 2009, 09:57:37 AM »
          I need it to open several programs in a certain order.  The problem I keep running into is white spaces in the directories or the folders I need opened.

          start C:\folder1\folder2\Folder To Be Opened


          Grimbear,

          I apologize that the thread was unable to remain on topic.

          Good luck with your project

          Salmon Trout

          • Guest
          Re: white spaces in path while using start command
          « Reply #28 on: December 09, 2009, 11:49:01 AM »
          I apologize that the thread was unable to remain on topic.

          Well, it was you, the banned loony, who helped drive it off topic, with your ridiculous posts, so maybe you should just STFU?

          Why are you still here, by the way?

          Grimbear13

            Topic Starter


            Rookie

            Re: white spaces in path while using start command
            « Reply #29 on: December 17, 2009, 10:06:23 AM »
            Sorry for not checking this one sooner.  This was something that wasn't critical for anything in particular so I actually forgot about it :o!  But now that I read it thank you so much for the support and I'm going to try some of the stuff that you all mentioned, namely the first set of quotes to declare title and then the full literal path.

            The variable there was just an attempt to force the folder to open something with a white space because I was hoping that through a variable it would take the literal string.

            Also i guess I should have mentioned what I was trying to do if I didn't this is a program to run at startup to open the 3 folders that I work out of at work, they need to be opened in sequence so I'm going to have to put a delay between each one because some open faster than others (they're on different drives).  It's a nominally simple task, but my unfamiliarity with batching complicates things  :(.  I'm hoping the start command is the proper command to have the folders opened.

            Thanks again for all the replies