Re: Basic question
From: Al Dunbar [MS-MVP] (alan-no-drub-spam_at_hotmail.com)
Date: 09/29/04
- Next message: Al Dunbar [MS-MVP]: "Re: Need to add error control on user account creation"
- Previous message: tin: "Re: having problem with this script - nevermind"
- In reply to: Torgeir Bakken \(MVP\): "Re: Basic question"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 29 Sep 2004 17:40:59 -0600
"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:OOffktlpEHA.3524@TK2MSFTNGP15.phx.gbl...
> GC wrote:
>
> > Hi,
> > I want to be able to create a text file with called <username>.txt with
some
> > info I have gathered from a script. In this VB script, how do I set the
> > file name to <username>.txt? I have it working fine with a static
entry.
> > Also, how would I do the same thing for a computer name? Thanks!
> >
> >
> Hi
>
> Set objWshNet = CreateObject("WScript.Network")
>
> WScript.Echo "User name: " & objWshNet.UserName
> WScript.Echo "Computer name: " & objWshNet.ComputerName
Not clear from the original question, but if the username is BILLY and you
want to create a file whose name is "<BILLY>.txt", then I would suggest you
find another set of characters to include in the name, as "<" and ">" are
syntactical landmines.
/Al
- Next message: Al Dunbar [MS-MVP]: "Re: Need to add error control on user account creation"
- Previous message: tin: "Re: having problem with this script - nevermind"
- In reply to: Torgeir Bakken \(MVP\): "Re: Basic question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|