Saved Bookmarks
| 1. |
Solve : How can I identify dynamic environment variables - SET does not help? |
|
Answer» gh0std0g74 - thanks for dropping in. 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.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.Quote from: BC_Programmer 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.)that's right. 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 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.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 it's also possible, that they are passing some items via command-line arguments to your batch file.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 |
|