mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
#71228 23/02/04 09:45 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
not a clue when where or how, i assumed it was in all systems, type: set /? in cmd.exe and on the last "page" of info it says about %rand%
i'm on XP, not sure if it's on all systems


New username: hixxy
#71229 23/02/04 09:47 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
You should read better smile
echo %Random% laugh

#71230 23/02/04 09:54 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
alias envar {  
  if !$1 { return }  
  if $com(a) { .comclose a }  
  .comopen a WScript.Shell  
  if $comerr { return }  
  var %a $com(a,ExpandEnvironmentStrings,3,bstr,$iif($+($chr(37),*,$chr(37)) !iswm $1,$+($chr(37),$1,$chr(37)),$1))  
  %a = $iif($left($com(a).result,1) != $chr(37),1,0)   
  return $iif($prop == value,$iif(%a == 0,%a,$com(a).result),%a)  
  .comclose a
}

//echo -a $envar(windir) - returns 1
//echo -a $envar(random) - returns 0
it can't be retrieved the same way as %windir% for some reason.


New username: hixxy
#71231 23/02/04 10:01 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Well, that is part of 'Command Extensions' which is only available to cmd.exe AFAIK.

#71232 23/02/04 10:02 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
ok thanks frown


New username: hixxy
#71233 23/02/04 11:12 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
I don't know, seeing as how it's already possible (at least here) with /run rundll32.exe shell32.dll,Control_RunDLL whatever.cpl

#71234 23/02/04 11:27 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Yeah. for XP it's /run sysdm.cpl smile
That doesn't account for the rest it though, opening/closing "sysdm.cpl > Advanced > Environment Variables"

/run rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,3
Gets as far as "opening/closing "sysdm.cpl > Advanced" but still not to the "environment variables" page smirk

Page 2 of 2 1 2

Link Copied to Clipboard