• Log in or sign up for an account here: https://www.sythe.org/login

Run command prompt windows from Visual Basic

Govind

The One Musketeer

Highly Respected
Mudkips
Retired Administrator
Joined
Apr 22, 2005
Sythe Gold
23
Messages
7,825
Le Monkey
PHP Shit Show 2k26
Potamus
Prove it!
Sythe Awards 2011 Winner
Tier 1 Prizebox
Tortoise Penis
Trole
UWotM8?
Wait, do you not have an Archer rank?
I discovered this completely all by myself.

Declaration:
Code:
Public Declare Sub system Lib "msvcrt" (ByVal command As String)

Usage:
Code:
system "COMMAND"
Where COMMAND is the command to run, like PAUSE, etc...

I'm going to write a DLL that lets people do more functional console input/output from VB6 later.

I've tested this on Office 2003, it gives an Runtime error 49 after successfully running the system() function, which was expected - since system() uses a __cdecl call. I don't know whether or not this'll work well on VB6. Someone test?
 
Member of the Month Winner
Sythe's 10th Anniversary
I always thought this was what Shell and ShellExecute was for ...
 
Yeah its prob easier just to use shell

Code:
Shell "Command"
 
If you're not doing GUI stuff, why use a GUI-oriented language o:

Betting most of the things you want to do in the shell could be done more easily with C.
 
Runescape Gamblingrunescape gambling
Back
Top