05. oktober 2001 - 08:30Der er
10 kommentarer og 1 løsning
Help.. skal have en fil til at eksekvere et dos program
Hejsa.. jeg skal have eksekveret et dos program så som tlntadmn.exe i win2k, og under dette skal den starte telnet services, med \"4\" jeg kan ikke rigtigt lavet det så det virker.. nogen som kan hjælpe?
Public Declare Function ShellExecute Lib \"shell32.dll\" Alias \"ShellExecuteA\" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Const SW_HIDE = 0 Public Const SW_SHOW = 5
Then this is how you use it.
result = ShellExecute(0, \"Open\", \"PathAndName\", \"\", \"Path\", SW_SHOW)
0) Quit this application 1) List the current users 2) Terminate a user session ... 3) Display / change registry settings ... 4) Start the service 5) Stop the service
Type an option number [0 - 5] to select that option:
Then i have to select option number 4.. how do I do this?
its empty! Have you declared the function? Public Declare Function ShellExecute Lib \"shell32.dll\" Alias \"ShellExecuteA\" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Declare Function ShellExecute Lib \"shell32.dll\" Alias \"ShellExecuteA\" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Const SW_HIDE = 0 Public Const SW_SHOW = 5
and then you call the function like this:
result = ShellExecute(0, \"Open\", \"PathAndName\", \"\", \"Path\", SW_SHOW)
YOU have to replace PathAndName with the FULL path and file name for example: \"C:\\temp\\runme.exe\" and you also have to replace path with \"C:\\TEMP\"
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.