Home > Software engineering >  With external programs, parameters in variable how to play?
With external programs, parameters in variable how to play?

Time:09-23

The
reference
Option Explicit
Dim the PWD, password, ws
Set the ws=CreateObject (" WScript. Shell ")
The PWD=InputBox (" set the SQL password: ")
Password=InputBox (" confirm password: SQL ")
If SAPWD=password then
Ws. The exec "setup. Exe SAPWD=PWD SECURITYMODE=SQL"
The else
Msgbox "two input inconsistent"
End the If

It was meant to be a MSDE and SQL2000 installation process automatically set the password of small tools, now at the last step, the setup we need to add "SAPWD" function, the function is set before the content of the variables, "SAPWD" this function will be VBS recognition as variable... For the optimal solution

CodePudding user response:

SAPWD add parentheses ()

CodePudding user response:

reference 1st floor bakw response:
SAPWD add parentheses ()

+ 1

CodePudding user response:

If SAPWD=password then
.
The else
Msgbox "two input inconsistent"
End the If
The PWD is the SAPWD here, shouldn't?

CodePudding user response:

The
reference
Option Explicit
Dim the PWD, password, ws
Set the ws=CreateObject (" WScript. Shell ")

The PWD=InputBox (" set the SQL password: ")
Password=InputBox (" confirm password: SQL ")
If the PWD=password then
Ws. The exec "setup.exe (SAPWD=PWD SECURITYMODE=SQL"
The else
Msgbox "two input inconsistent"
End the If

Reply to the two floor car, is that right? Not test, prompt "request operation requires ascension"
Reply to 34 floor, in front of the wrong number

CodePudding user response:

Stupid to die ah:
Ws. The exec "setup. Exe SAPWD=" & amp; The PWD & amp; "SECURITYMODE=SQL"

CodePudding user response:

The
reference
Option Explicit
Dim the PWD, password, ws
Set the ws=CreateObject (" WScript. Shell ")

The PWD=InputBox (" set the SQL password: ")
Password=InputBox (" confirm password: SQL ")
If the PWD=password then
Ws. The exec "setup. Exe SAPWD=" & amp; The PWD & amp; "SECURITYMODE=SQL"
The else
Msgbox "two input inconsistent"
End the If

According to the fifth floor to ~ like or...
Error: request operation requires ascension, code: 800702 e4 source: WshShell. Exec

CodePudding user response:

His tip, and solving

CodePudding user response:

Should write?
Ws. The exec "setup. Exe SAPWD ()=" & amp; The PWD & amp; "SECURITYMODE=SQL"

I don't know how your "SAPWD function" need operation to be invoked,

CodePudding user response:

According to the vb project launch parameters method, the following statement
Ws. The exec "setup. Exe SAPWD=" & amp; The PWD & amp; "SECURITYMODE=SQL"
Should be correct,

Then in engineering form_load, can be resolved from the command SAPWD and SECURITYMODE two parameter values...


The format of the various engineering pass parameters varied, I think you should look to pass an argument about the setup instructions, perhaps is like this:
Ws. The exec "setup.exe" & amp; The PWD & amp; "SQL"
  •  Tags:  
  • VBA
  • Related