mIRC Home    About    Download    Register    News    Help

Print Thread
#247073 20/07/14 04:56 PM
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Hello,

I wanna request to add an $windir identifier that will return the WINDOWS folder direction.

E.g: //echo $windir
Results: C:\Windows\

- Thanks!


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #247074 20/07/14 05:08 PM
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Why not, in the meantime:

Code:
alias windir {
  .comopen env WScript.Shell
  if ($com(env,ExpandEnvironmentStrings,3,bstr,$+(%,windir%))) var %r $com(env).result
  .comclose env
  return $iif(%r != $+(%,windir%),%r)
}


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
westor #247090 20/07/14 10:54 PM
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
Instead of an identifier for each PATH stored in the Environment PATH variable, why not just a single alias, able of evaluating a specified path:

Code:
alias envvar {
  .comopen env WScript.Shell
  if ($com(env, ExpandEnvironmentStrings, 3, bstr, $+(%, $1, %))) {
    var %res $com(env).result
  }
  .comclose env
  return $iif(%res != $+(%,$1,%), %res)
}

; examples:
alias appdata return $envvar(appdata)
alias windir return $envvar(windir)


I am SReject
My Stuff
FroggieDaFrog #247109 21/07/14 11:21 AM
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
These COM aliases are useful but i think the mIRC is good to have one of these or something like this to return some useful paths of windows, it would be nice to see one of these command to be added into the next version.

- Thanks!


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #247111 21/07/14 12:17 PM
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
Im not against something similar being added, but was merely stating if it were to be added, I think it should be a single identifier that returns a specified element in the Envvar PATH variable, instead of adding identifiers for each path stored.


I am SReject
My Stuff

Link Copied to Clipboard