Foro de elhacker.net

Programación => Scripting => Mensaje iniciado por: chewarrior en 25 Marzo 2010, 12:47 pm



Título: variables del entorno en vbscritp
Publicado por: chewarrior en 25 Marzo 2010, 12:47 pm
alguien me puede decir que variables de entorno ay para vbs y como se aplican

GRACIAS




Título: Re: variables del entorno en vbscritp
Publicado por: Novlucker en 25 Marzo 2010, 12:58 pm
Las mismas que para batch ...

Código
  1. set objshell = createobject("wscript.shell")
  2. user = objshell.expandenvironmentstrings("%USERNAME%")
  3. Msgbox "Hola " & user

Otra manera de conseguir algunas carpetas de sistema ...

Código
  1. set objfso = createobject("scripting.filesystemobject")
  2. set windows = objfso.getspecialfolder(0)
  3. set system = objfso.getspecialfolder(1)
  4. set temp = objfso.getspecialfolder(2)
  5. Msgbox windows.path
  6. Msgbox system.path
  7. Msgbox temp.path

Por último, algunas carpetas especiales de win ...

Código
  1. set objshell = createobject("wscript.shell")
  2. Escritorio = objshell.specialfolders("Desktop")
  3. Msgbox Escritorio
:http://msdn.microsoft.com/en-us/library/0ea7b5xe%28VS.85%29.aspx

Saludos ;)