Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Get username in vbscript

Reply
 
Old 08-20-2009   #1 (permalink)
vqthomf


 
 

Get username in vbscript

I have been trying to get the username into a textbox because of my vba
background I have been trying to use environ("Username") is there another way
of doing this or am I barking up the wrong tree?
any help will much appreciated
Regards

My System SpecsSystem Spec
Old 08-20-2009   #2 (permalink)
arno


 
 

Re: Get username in vbscript

It's available from the WshNetwork object. You have downloaded the
VBScript documentation files from Microsoft, right? If not, do so,
quickly!

arno

On Thu, 20 Aug 2009 03:36:53 -0700, vqthomf
<vqthomf@xxxxxx> wrote:
Quote:

>I have been trying to get the username into a textbox because of my vba
>background I have been trying to use environ("Username") is there another way
>of doing this or am I barking up the wrong tree?
>any help will much appreciated
>Regards
My System SpecsSystem Spec
Old 08-20-2009   #3 (permalink)
Pegasus [MVP]


 
 

Re: Get username in vbscript


"vqthomf" <vqthomf@xxxxxx> wrote in message
news:3BB1A152-2016-448B-B915-1A86BA3F1EE1@xxxxxx
Quote:

>I have been trying to get the username into a textbox because of my vba
> background I have been trying to use environ("Username") is there another
> way
> of doing this or am I barking up the wrong tree?
> any help will much appreciated
> Regards
Here you go:
Set oWshShell = CreateObject("WScript.Shell")
MsgBox oWshShell.ExpandEnvironmentStrings("User name=%UserName%")


My System SpecsSystem Spec
Old 08-20-2009   #4 (permalink)
vqthomf


 
 

Re: Get username in vbscript

Thanks for the help it works on my compter but it wont work on my boss
computer the error asked for wscript??
Regards

"Pegasus [MVP]" wrote:
Quote:

>
> "vqthomf" <vqthomf@xxxxxx> wrote in message
> news:3BB1A152-2016-448B-B915-1A86BA3F1EE1@xxxxxx
Quote:

> >I have been trying to get the username into a textbox because of my vba
> > background I have been trying to use environ("Username") is there another
> > way
> > of doing this or am I barking up the wrong tree?
> > any help will much appreciated
> > Regards
>
> Here you go:
> Set oWshShell = CreateObject("WScript.Shell")
> MsgBox oWshShell.ExpandEnvironmentStrings("User name=%UserName%")
>
>
>
My System SpecsSystem Spec
Old 08-20-2009   #5 (permalink)
vqthomf


 
 

Re: Get username in vbscript

It's ok now we got it work on both he had wscript.network and not .sheel
thanks to you all I have a load of books and help files and I still find it
hard, I think because my boss want to jump before we can walk but then he is
the boss.
Regards

"Pegasus [MVP]" wrote:
Quote:

>
> "vqthomf" <vqthomf@xxxxxx> wrote in message
> news:3BB1A152-2016-448B-B915-1A86BA3F1EE1@xxxxxx
Quote:

> >I have been trying to get the username into a textbox because of my vba
> > background I have been trying to use environ("Username") is there another
> > way
> > of doing this or am I barking up the wrong tree?
> > any help will much appreciated
> > Regards
>
> Here you go:
> Set oWshShell = CreateObject("WScript.Shell")
> MsgBox oWshShell.ExpandEnvironmentStrings("User name=%UserName%")
>
>
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Vista login "incorrect username or password" with correct username and password entry Vista General
Username and password Vista mail
Username Change Vista General
How to get first, last and username from AD PowerShell
How to do No hang up VBScript (nohup for VBScript) VB Script


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46