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

Author Topic: How can I identify dynamic environment variables - SET does not help  (Read 12272 times)

0 Members and 1 Guest are viewing this topic.

Dusty



    Egghead

  • I could if she would, but she won't so I don't.
  • Thanked: 75
  • Experience: Beginner
  • OS: Windows XP
Re: How can I identify dynamic environment variables - SET does not help
« Reply #15 on: June 07, 2009, 09:39:22 PM »
gh0std0g74 - thanks for dropping in.

Quote from: gh0std0g74
cause AFAIK, %DATE% , %TIME% or %RANDOM% are little things that cmd.exe gives you out of convenience, they are not environment variables.

The Set command Help display (set/?) names these as "dynamic environment variables". AFAIK the placeholder does not contain a value, the value is computed when the dynamic environment variable is expanded.  Not containing a value means that the dyn env var cannot be displayed using Set, there simply isn't anything to display.

Regards

D.
One good deed is worth more than a year of good intentions.

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: How can I identify dynamic environment variables - SET does not help
« Reply #16 on: June 07, 2009, 10:04:16 PM »
What ghostdog means is, they are not "really" environment variables, in that they do not reside in the environment block (which is basically what "set" shows.)

Also- applications can only change the environment block- including acronis.

I would imagine that they documented what variables they define.
I was trying to dereference Null Pointers before it was cool.

gh0std0g74



    Apprentice

    Thanked: 37
    Re: How can I identify dynamic environment variables - SET does not help
    « Reply #17 on: June 07, 2009, 10:57:55 PM »
    What ghostdog means is, they are not "really" environment variables, in that they do not reside in the environment block (which is basically what "set" shows.)
    that's right.

    ALAN_BR

      Topic Starter


      Hopeful

      Thanked: 5
      • Computer: Specs
      • Experience: Experienced
      • OS: Windows 7
      Re: How can I identify dynamic environment variables - SET does not help
      « Reply #18 on: June 08, 2009, 08:54:57 AM »
      Dusty

      When I first saw you jpeg I could not read it until I clicked and it enlarged.
      When enlarged I saw " %cmdcmd line% ".
      I now realize my tired eyes misplaced the space, it now looks like %cmdcmdl ine%,
      but when I greatly magnify the image I realize the "space" is an artifact due to "DOS" not using proportional spacing.

      Thank you for your explanation.  The world makes a little more sense now.

      Thank you for the link to "The uses of Setlocal Enabledelayedexpansion",
      and also for pointing me back to the use of "SET /?" - previously I never read through to the end because my problems were usually resolved halfway through ! !

      Thanks to everyone who recently posted.

      If Acronis created a variable "acronis_in_variable" I would be O.K. with "set acro=%acronis_in_variable%".
      Unfortunately I do not know the name(s) of any variables they may create,
      and do not even know if they create any at all.

      n.b. My interest is in ANY sort of variable that Acronis may use or influence,
      not just fixed and dynamic, but also other sorts (I vaguely remember last year I encountered at least two other sorts, including "dynamic").

      Regards
      Alan

      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: How can I identify dynamic environment variables - SET does not help
      « Reply #19 on: June 08, 2009, 11:05:11 AM »
      I think, what your seeing as "dynamic" variables, are merely variables Acronis adds before running your script.

      See, when a program executes another program, it can pass a new environment block to that program. Acronis, for example, is possibly adding new variables to it's environment block and passing that as the environment of the script.

      Havey you tried using "SET" from within your script? perhaps redirecting it to a file? This will reveal such variables.

      I still believe that Acronis would have this type of stuff documented somewhere.
      I was trying to dereference Null Pointers before it was cool.

      ALAN_BR

        Topic Starter


        Hopeful

        Thanked: 5
        • Computer: Specs
        • Experience: Experienced
        • OS: Windows 7
        Re: How can I identify dynamic environment variables - SET does not help
        « Reply #20 on: June 08, 2009, 04:06:33 PM »
        Hi

        No, we have a misunderstanding.

        I have never seen any sort of variable that looked as though it was related to Acronis.
        I merely hoped that there was such a variable that might give me a clue upon what it was doing.

        I have already tried
        Code: [Select]
        ECHO CMDCMDLINE == %CMDCMDLINE% >> C:\Utils\CMD\ToBak.txt
        SET  >> C:\Utils\CMD\ToBak.txt
        The first item shows me command issued by Acronis, which was
        CMDCMDLINE == cmd /c ""C:\Utils\CMD\ToBak.cmd"  A B C D"

        I had been hoping to learn of other dynamic/volatile/special variables, such as %CMDCMDLINE%, which SET does not display, but which are displayed with a suitable
        Code: [Select]
        ECHO %whatever%
        to give me a further insight.

        I have already inspected several MBytes of Acronis documentation without success,
        and have also posted queries on the Acronis support forum looking for specific guidance.

        I have lost hope of finding any useful Acronis variable of any sort, and think they probably have not created any such thing, so I am giving up on this and will use a totally different approach to meeting my requirements.

        My thanks to everyone who has responded to this thread.
        I have gained extra useful knowledge, even though my original quest has failed

        Regards
        Alan

        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: How can I identify dynamic environment variables - SET does not help
        « Reply #21 on: June 08, 2009, 04:09:11 PM »
        it's also possible, that they are passing some items via command-line arguments to your batch file.
        I was trying to dereference Null Pointers before it was cool.

        ALAN_BR

          Topic Starter


          Hopeful

          Thanked: 5
          • Computer: Specs
          • Experience: Experienced
          • OS: Windows 7
          Re: How can I identify dynamic environment variables - SET does not help
          « Reply #22 on: June 08, 2009, 04:19:04 PM »
          Yes,  my script captures
          CMDCMDLINE == cmd /c ""C:\Utils\CMD\ToBak.cmd"  A B C D"

          The trailing "A B C D" are the only arguments that I receive, and they do not help me either !

          Regards
          Alan