Computing.Net > Forums > Programming > Visual Basic shell command or run

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

Visual Basic shell command or run

Reply to Message Icon

Original Message
Name: gooter005
Date: November 29, 2006 at 17:20:56 Pacific
Subject: Visual Basic shell command or run
OS: XP Home
CPU/Ram: amd xp 2600 333, 384 DDr
Comment:

Ok i want to beable to use the shell command to start gens.exe (sega emulator) and load a game automaticly all from one line of code.

Edog


Report Offensive Message For Removal


Response Number 1
Name: Chi Happens
Date: November 30, 2006 at 04:44:46 Pacific
Reply: (edit)

Use the Win32 API called ShellExecute:

Private 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
Const SW_SHOW = 5

ShellExecute 0,"OPEN","gens.exe","gamename","C:\Path To gens.exe", SW_SHOW

Enjoy,
Chi Happens
They mostly come at night...mostly.


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge
Poll History




Data Recovery Software