p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_howto thread: Windws Scripting


Message #1 by "Kruschev Balcora" <balcora@y...> on Wed, 4 Dec 2002 05:10:22
Since you sent this post to ASP related mailing-list, I suppose this 
code is
a part of an ASP file.  In this case, I don't think you could do like 
this
for two reasons:
1) WScript isn't available in ASP context.  It's only for WSH context.
2) MsgBox isn't available in ASP server-side either.


> -----Message d'origine-----
> De : Kruschev Balcora [mailto:balcora@y...]
> Envoy=C3=A9 : mercredi 4 d=C3=A9cembre 2002 06:10
> =C3=80 : Pro ASP HowTo
> Objet : [proasp_howto] Windws Scripting
>
>
> i have this script that gets the current user logged on in
> windows. the
> problem is it doesnt return anything. can somebody help? thanks.
>
> <Script Language=3D"VBScript">
> 	On Error Resume Next
>
> 	Dim objNet
> 	Set objNet =3D CreateObject("WScript.Shell")
> =09
> 	Dim strInfo
> 	strInfo =3D "User Name is     " & objNet.UserName & vbCRLF & _
> 	          "Computer Name is " & objNet.ComputerName & vbCRLF & _
>  	          "Domain Name is   " & objNet.UserDomain
>
> 	MsgBox strInfo
>         Set objNet =3D Nothing
> </Script>
>

  Return to Index