Windows Vista Forums

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

  1. #1


    carol wang Guest

    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

  2. #2


    Pegasus [MVP] Guest

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

    *** See below.

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

    >
    > 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.

    > 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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
WshShell.Exec workaround Innerlab VB Script 1 24 Aug 2009
Vista login "incorrect username or password" with correct username and password entry accidentmagnet Vista General 5 04 Jul 2009
Using WshShell.Exec and retrieving output Richard Wells VB Script 0 19 Mar 2009
WshShell.RegRead Fred VB Script 6 17 Mar 2009
Supplying a variable to wshshell.Run jmedd VB Script 0 18 Jun 2008