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 - some questions about 'username' and 'WSHshell.run'

Reply
 
Old 07-23-2009   #1 (permalink)
carol wang


 
 

some questions about 'username' and 'WSHshell.run'


Hi,everyone!I'm new here.
my company had to upgrade several softwares,so i made a little

program by VBScript.when all the users used my program to upgrade

their softwares,some problems happened. here are the problems:

1. if userDom="NTDM001" then
(copy some files)
elseif userDom > "PC4999" and userDom<"PC6000" then
if userNam = "VBSADMIN" then
(copy some other files)
else
WSHShell.Popup "Please log on with

VBSADMIN.",0,"VBSITMGR",16
WScript.Quit
end if
end if

there are several users,domain user and two local users,we want users

to logon with domain user or local user(VBSADMIN),when they logon

with another local user(VBSUSER),the popup will show(Please log on

with VBSADMIN.).the problem is when some users logon with VBSUSER,the
program recognized them as VBSADMIN.I don't know what's wrong,maybe

the program is not profect.

2.objnotesJ=WSHShell.Run(CTemp&"notes8j.exe /w",, True)
objExec = WSHShell.Run(CTemp&"Notes8j\setup.exe /w",, True)

after unpack the compressed file(notes8j.exe),the program will run

setup.exe,it happened to a few computers,the program didin't run

setup.exe,and there wasn't error message either.

Plese help me find the answers.



*** Sent via Developersdex http://www.developersdex.com ***

My System SpecsSystem Spec
Old 07-23-2009   #2 (permalink)
Pegasus [MVP]


 
 

Re: some questions about 'username' and 'WSHshell.run'

*** See below.

"carol wang" <carolwinjapan@xxxxxx> wrote in message
news:Om$Td32CKHA.3368@xxxxxx
Quote:

>
> Hi,everyone!I'm new here.
> my company had to upgrade several softwares,so i made a little
>
> program by VBScript.when all the users used my program to upgrade
>
> their softwares,some problems happened. here are the problems:
>
> 1. if userDom="NTDM001" then
> (copy some files)
> elseif userDom > "PC4999" and userDom<"PC6000" then
> if userNam = "VBSADMIN" then
> (copy some other files)
> else
> WSHShell.Popup "Please log on with
>
> VBSADMIN.",0,"VBSITMGR",16
> WScript.Quit
> end if
> end if
>
> there are several users,domain user and two local users,we want users
> to logon with domain user or local user(VBSADMIN),when they logon
> with another local user(VBSUSER),the popup will show(Please log on
> with VBSADMIN.).the problem is when some users logon with VBSUSER,the
> program recognized them as VBSADMIN.I don't know what's wrong,maybe
> the program is not profect.
*** Sorry, can't say - you're not telling us where the variable "userNam"
*** comes from.
Quote:

> 2.objnotesJ=WSHShell.Run(CTemp&"notes8j.exe /w",, True)
> objExec = WSHShell.Run(CTemp&"Notes8j\setup.exe /w",, True)
>
> after unpack the compressed file(notes8j.exe),the program will run
> setup.exe,it happened to a few computers,the program didin't run
> setup.exe,and there wasn't error message either.
> Plese help me find the answers.
*** Same thing - we don't know what the variable "CTemp" is set to.
*** You can probably work it out yourself by inserting this line
*** in your code:
*** wscript.echo "Command=" & CTemp & "Notes8j\setup.exe /w"
*** Note also that the line "objExec = " is misleading. The "Run"
*** method returns an integer, not an object.


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
WshShell.Exec workaround VB Script
Vista login "incorrect username or password" with correct username and password entry Vista General
Using WshShell.Exec and retrieving output VB Script
WshShell.RegRead VB Script
Supplying a variable to wshshell.Run 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