Sunday 10 November 2013

cmd/windows variables

command prompt has some of the pre stored or default variables.....,
I know,You some times types %temp% on run dialog box to access your temporary directory(if you didn't, Try it out..)
But do you know its a variable(constant one) in windows if type something inside those %s(percent tags) that is a variable these variables are created as soon as you switch your user accounts on for the first time...
Well some of the predefined are below (open your explorer[not ie,okay]and type them,in address bar..)

  • %commonprogramfiles%
  • %localappdata%
  • %programfiles%
  • %systemroot%
  • %random%
  • %temp%
  • %userprofile%
  • %windir%
Try them out find what it results to.
You can try it in cmd as well but it won't put you in that directory,instead it well display the value of the variable and says command not found.
In something,like this pattern "C:\Users\your_name' is not recognized as an internal or external command, operable program or batch file."
You can create your own variables open cmd type in 'set  n="command/location/anything" '
set is used to declare a variable
and n is the variable you can use any word except the predefineds  and in double quotes type your command or the location you can type anything in that qoutes, Mostly used in batch programming..
To call your variables by % tags (no phones works here.. :-D)
Aha bad news you can't call your variables with the explorer you can use it only in cmd ie. locally you can't have an ISD call....
Bye,till then
LIVE,BREATHE AND BLOG.......

No comments:

Post a Comment