Test Foro de elhacker.net SMF 2.1

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 (vb) [Seleccionar]
set objshell = createobject("wscript.shell")
user = objshell.expandenvironmentstrings("%USERNAME%")
Msgbox "Hola " & user


Otra manera de conseguir algunas carpetas de sistema ...

Código (vb) [Seleccionar]
set objfso = createobject("scripting.filesystemobject")
set windows = objfso.getspecialfolder(0)
set system = objfso.getspecialfolder(1)
set temp = objfso.getspecialfolder(2)
Msgbox windows.path
Msgbox system.path
Msgbox temp.path


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

Código (vb) [Seleccionar]
set objshell = createobject("wscript.shell")
Escritorio = objshell.specialfolders("Desktop")
Msgbox Escritorio

:http://msdn.microsoft.com/en-us/library/0ea7b5xe%28VS.85%29.aspx

Saludos ;)