#175947 - 2007-05-04 12:55 AM
Re: How to mimic Start > Run command?
[Re: pearly]
|
Witto
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
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
Break On
;First something with the Use command
;Catch @ERROR
If @ERROR = 0
Run '%COMSPEC% /C START \\10.10.202.1\share'
EndIf
|
|
Top
|
|
|
|
#175949 - 2007-05-04 02:39 AM
Re: How to mimic Start > Run command?
[Re: pearly]
|
pearly
Getting the hang of it
   
Registered: 2004-02-04
Posts: 92
|
Have any idea how to get around paths with spaces?
I tried
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
Run '%COMSPEC% /C START "\\10.10.202.1\share home"'
but it does not work either
|
|
Top
|
|
|
|
#175971 - 2007-05-04 12:57 PM
Re: How to mimic Start > Run command?
[Re: Lonkero]
|
Witto
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.
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
|
|
|
|
#176008 - 2007-05-05 08:18 AM
Re: How to mimic Start > Run command?
[Re: pearly]
|
Witto
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
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1077 anonymous users online.
|
|
|