Page 1 of 1 1
Topic Options
#175945 - 2007-05-04 12:14 AM How to mimic Start > Run command?
pearly Offline
Getting the hang of it
*****

Registered: 2004-02-04
Posts: 92
Particularly when accessing a private network drive by entering in the path in Start > Run field (e.g. \\10.10.202.1\share\), it displays the 'Connect to 10.10.202.1' window.

I need to know how to display this so the user can enter in their user credentials.

Top
#175947 - 2007-05-04 12:55 AM Re: How to mimic Start > Run command? [Re: pearly]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Does each user have his own credentials to access \\10.10.202.1 or do you use one general UserID and Password eventually known by any user?
I would think you first do a Use, per example
 Code:
Use \\10.10.202.1 /USER:"NameOffSystem\GeneralUser" /Password:"C-cret2Enter!System"

or catch name and password by user input and feed it to Use
if the Use is successfull (@ERROR = 0), you can open a browser
 Code:
Break On
;First something with the Use command
;Catch @ERROR
If @ERROR = 0
	Run '%COMSPEC% /C START \\10.10.202.1\share'
EndIf

Top
#175948 - 2007-05-04 02:28 AM Re: How to mimic Start > Run command? [Re: Witto]
pearly Offline
Getting the hang of it
*****

Registered: 2004-02-04
Posts: 92
Since each has his/her own credentials the latter code worked great. Many thanks!
Top
#175949 - 2007-05-04 02:39 AM Re: How to mimic Start > Run command? [Re: pearly]
pearly Offline
Getting the hang of it
*****

Registered: 2004-02-04
Posts: 92
Have any idea how to get around paths with spaces?

I tried

 Code:
Run '%COMSPEC% /C START \\10.10.202.1\share home'


where 'share home' is a folder name and it doesn't like it.

I also tried

 Code:
Run '%COMSPEC% /C START "\\10.10.202.1\share home"'


but it does not work either

Top
#175950 - 2007-05-04 03:59 AM Re: How to mimic Start > Run command? [Re: pearly]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
If you bring up the help with:
 Code:
C:\>start /?
Starts a separate window to run a specified program or command.

START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
      [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
      [/WAIT] [/B] [command/program]
      [parameters]

    "title"     Title to display in  window title bar.

You will see the first parm in "quotes" is the title so you need to include the title first.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#175951 - 2007-05-04 04:07 AM Re: How to mimic Start > Run command? [Re: Les]
pearly Offline
Getting the hang of it
*****

Registered: 2004-02-04
Posts: 92
i noticed it, but didn't think much of it. thanks after putting in the title arg, putting quotes around the path did the trick
Top
#175953 - 2007-05-04 09:05 AM Re: How to mimic Start > Run command? [Re: pearly]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
you don't actually want to display the box but for someone who really wants and needs to display it, this should do the trick:

 Code:
run 'explorer.exe "\\server\share"'
_________________________
!

download KiXnet

Top
#175971 - 2007-05-04 12:57 PM Re: How to mimic Start > Run command? [Re: Lonkero]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
That is right. Explorer.exe is the program to start.
To get the password from the customer, you could write a loop and check until @ERROR = 0.
 Code:
Do
	If 0 <> @ERROR
		CLS
		"Wrong password, try again: "
	Else
		"Give your password (blank = Cancel): "
	EndIf
	Gets $RC
	If NOT $RC = ""
		Use "\\server" /USER:"server\UserID" /Password:$RC
	EndIf
Until 0 = @ERROR

By working with Get and evaluate the input, I think you can even hide the password on the screen.

Top
#176000 - 2007-05-04 10:58 PM Re: How to mimic Start > Run command? [Re: Witto]
pearly Offline
Getting the hang of it
*****

Registered: 2004-02-04
Posts: 92
Thanks Witto, Les, and Jooel.

I tweaked my program to pop-up the Login info box when needed.

Top
#176008 - 2007-05-05 08:18 AM Re: How to mimic Start > Run command? [Re: pearly]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Maybe a way to silence the password input
;*************************************************************************
; Script Name: GetPassword
; Author: Wim Rotty
; Date: 5/05/2007
; Description: Get screen input without displaying anything on the screen
;************************************************************************* 


;Example

;If Not @LOGONMODE
;     Break On
;Else
;     Break Off
;EndIf
;DIM $RC
;$RC=SetOption("Explicit", "On")
;$RC=SetOption("NoMacrosInStrings", "On")
;$RC=SetOption("NoVarsInStrings", "On")
;$RC=SetOption("WrapAtEOL", "On")
;
;DIM $strSecret

;$strSecret = GetPassword()
;$strSecret ?

Function
GetPassword()

   
DIM
$chrTemp

   
Do

   
   
Get
$chrTemp

   
   
Select

            ;ASCII value 8 = Backspace
            Case 8 = ASC($chrTemp)
               
;Whipe the last character
                $GetPassword = Left($GetPassword, Len($GetPassword)-1)
           
;Usable Characters start at ASCII value 32
            Case ASC($chrTemp) > 31
               
;Add character at the end
                $GetPassword = $GetPassword + $chrTemp
        EndSelect
    ;End if input was Enter, ASCII value 13 = Carriage Return
    Until 13 = ASC($chrTemp)
   
Exit @ERROR
EndFunction

Top
#176009 - 2007-05-05 10:35 AM Re: How to mimic Start > Run command? [Re: Witto]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
eh.
now I finally read what pearly asked and actually understand it.

so, why you guys give the examples to code in commandline when he asked for the gui???
_________________________
!

download KiXnet

Top
#176011 - 2007-05-05 03:24 PM Re: How to mimic Start > Run command? [Re: Lonkero]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Hey! Don't tar me with a broad brush. I didn't offer a commandline solution. I simply pointed out the error in the use of START with regard to quoted parms and "title".
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#176012 - 2007-05-05 05:50 PM Re: How to mimic Start > Run command? [Re: Les]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yeah.
but, it's an optional parm.
_________________________
!

download KiXnet

Top
#176058 - 2007-05-07 06:26 PM Re: How to mimic Start > Run command? [Re: Lonkero]
pearly Offline
Getting the hang of it
*****

Registered: 2004-02-04
Posts: 92
it brings up the gui, so i'm happy with it.

thanks guys.

Top
#176068 - 2007-05-07 07:24 PM Re: How to mimic Start > Run command? [Re: pearly]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
which one?
_________________________
!

download KiXnet

Top
#176072 - 2007-05-07 07:36 PM Re: How to mimic Start > Run command? [Re: Lonkero]
pearly Offline
Getting the hang of it
*****

Registered: 2004-02-04
Posts: 92
the START command
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1077 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.207 seconds in which 0.144 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org