Loading ...
Sorry, an error occurred while loading the content.

Help with Dos command

Expand Messages
  • John Shotsky
    I ve added an ability to run Dos commands in my clips, but have run up against the problem with spaces in Dos filenames. My clip stores the active file name in
    Message 1 of 3 , Apr 27, 2009
    • 0 Attachment
      I've added an ability to run Dos commands in my clips, but have run up against the problem with spaces in Dos filenames.

      My clip stores the active file name in one variable.
      My clip stores the current path in a different variable (it's the destination for files created by the Dos command.)
      My clip stores the path to the Dos command in another variable.

      I'm storing the files to work with in:
      D:\Work Area
      My file name is:
      D:\Work Area\My File.txt

      The command is stored in:
      D:\Test, but it could be D:\Test Area.

      The command to perform the work is: (And it works, if no spaces in paths or file names.)
      ^!Dos java -jar ^%GetFDXPhotos% ^%WorkingFilePath% ^%WorkingFile%

      Any of these variables could contain a path or a file name with spaces. So, I need to surround these variables with
      double quotes, but it's not clear from the help files how to do this. This is my first experience with the Dos command
      in NoteTab, and it's been a while since I was proficient with Dos. Should I restate the variables so that there are
      double quotes stored within the variable, or can I just add them into the Dos command above?

      Note that when there were no spaces in the paths, I could just put quotes around the WorkingFile variable, and it
      worked. (But not without the quotes)
      ^!Dos java -jar ^%GetFDXPhotos% ^%WorkingFilePath% "^%WorkingFile%"

      Any ideas?

      John




      [Non-text portions of this message have been removed]
    • Sheri
      ... I would not try to store double quotes within your variables. Just try quotes around each one on the command line. Or if you want short paths you can use
      Message 2 of 3 , Apr 27, 2009
      • 0 Attachment
        --- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@...> wrote:
        > Should I restate the variables so that there are double quotes
        > stored within the variable, or can I just add them into the Dos
        > command above?

        I would not try to store double quotes within your variables. Just try quotes around each one on the command line. Or if you want short paths you can use
        ^$GetShort(^%pathvariable%)$

        Depending on what the command line does, you may find

        ^!InsertText ^$GetOutput(command line)$

        is better than using ^!Dos

        Regards,
        Sheri
      • Sheri
        Curiously the below message was posted and appeared this morning at the web site, but I never got it in email. Yahoo is definitely not acting right.
        Message 3 of 3 , Apr 27, 2009
        • 0 Attachment
          Curiously the below message was posted and appeared this morning at the web site, but I never got it in email. Yahoo is definitely not acting right.

          --- In ntb-clips@yahoogroups.com, "Sheri" <silvermoonwoman@...> wrote:
          >
          > --- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@> wrote:
          > > Should I restate the variables so that there are double quotes
          > > stored within the variable, or can I just add them into the Dos
          > > command above?
          >
          > I would not try to store double quotes within your variables. Just try quotes around each one on the command line. Or if you want short paths you can use
          > ^$GetShort(^%pathvariable%)$
          >
          > Depending on what the command line does, you may find
          >
          > ^!InsertText ^$GetOutput(command line)$
          >
          > is better than using ^!Dos
          >
          > Regards,
          > Sheri
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.