Summary of five methods for shell.application to execute commands

Time:2020-1-21

At the beginning, when Lao Ma wrote this version, I tested two versions of 2003, which were easy to use. I guess it’s probably related to ms06014 in 2003. Kyo put forward solutions in the freezing point forum. I studied this component this afternoon and found that it has five methods to execute commands. The following is VBS Version (asp version does not provide it. How to use asp version to run commands in 2003’s webshell, solve it by yourself: -):

Copy codeThe code is as follows:
Set objShellApp = CreateObject(“Shell.Application“)
Set objFolder = objShellApp.NameSpace(“c:\”)
ObjFolder. Items(). Item (“demo. Exe”). Invokeverb ‘method 1
ObjFolder. Items(). Item (“demo. Exe”). Invokeverbex ‘method 2
Objshellapp. Open (“C: \ demo. Exe”) ‘method 3

Objshellapp.shellexecute “demo. Exe”, “”, “C: \”, “”, “1” method 4, you can add parameters and set parameter values

Method 5
Set objFolderItem = objShellApp.NameSpace(“C:\”).Items().item(“demo.exe”)
Set objFIVs = objFolderItem.Verbs()
For i=0 To objFIVs.Count – 1
‘MsgBox objFIVs.Item(i)
Set objFIV = objFIVs.Item(i)
If objfiv.name = “open” & then “in the right-click menu, the Chinese system is” open “& and English is changed by itself
objFIV.DoIt
Exit For
End IF
Next

Recommended Today

RCAST 35: add type to currency

– font ALT: Simsun; MSO font charset: 134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 680460288 22 0 262145 0;} @font-face {font-family:”Cambria Math”; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-family:Calibri; Variable; Ose-1: 216301111; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 680460288 22 0 262145 0;} /\* Style […]