Visual Basic 6.0

Gigabyte / M52s-s3p
April 2, 2009 at 00:04:13
Specs: Microsoft Windows XP Professional, 2.31 GHz / 3582 MB
Hey,
I'm not completely sure were to post this.
A while back I purchased a copy of Visual
Basic 6.0 (not sure were from) really cheap.

I tested it for the first time yesterday.

I made a menu (Doesn't look to flash-hot but
beats the batch version i had originally) for a
program i made that makes "contact files" for
people.

I wanted to know if it is possible to "include"
the two .exe files i compiled out of two separate batch files in the compiled version of
the menu.
Probably a simple question but I cant seem to
figure it out myself.

What the batch files do is really simple. They take user output as the name and make a set of folders containing contact information about that person. I will include the two batch files just incase they help. If you know how to write them shorter, that would also be appreciated :P

::________________________________
::
::Start Of Batch
::________________________________

::People Manager - Maker
:: BY LEoH

@ECHO OFF
COLOR F2
CD..
CLS

rem Start

:1
CLS
set /p al=Type Last Name:
set al=%al%
DIR "%al%" > nul
IF ERRORLEVEL 1 GOTO :1.1
IF NOT ERRORLEVEL 1 GOTO :1.2

:1.1
MKDIR "%al%
GOTO :1.3

:1.2
CD "%al%"
GOTO :1.3

:1.3
CLS
set /p af=Type First Name:
set af=%af%
DIR "%af%" > nul
IF ERRORLEVEL 1 GOTO :1.4
IF NOT ERRORLEVEL 1 GOTO :1.5

:1.4
CD "%al%"
MKDIR "%af%
CD "%af%"

MKDIR Contact
CD Contact

MKDIR Home
CD Home
ECHO.____________________________________________ >> Home.LEO
ECHO. >> Home.LEO
ECHO.Home >> Home.LEO
ECHO.____________________________________________ >> Home.LEO
ECHO. >> Home.LEO
ECHO.Street Adress :>> Home.LEO
ECHO.City :>> Home.LEO
ECHO.State :>> Home.LEO
ECHO.P/C :>> Home.LEO
ECHO.Country :>> Home.LEO
CD..

MKDIR General
CD General
ECHO.____________________________________________ >> Information.LEO
ECHO. >> Information.LEO
ECHO.General >> Information.LEO
ECHO.____________________________________________ >> Information.LEO
ECHO. >> Information.LEO
ECHO.Name : %af% %al%>> Information.LEO
ECHO.Age :>> Information.LEO
ECHO.B/D :>> Information.LEO
ECHO. >> Information.LEO
ECHO.Home Adress :>> Information.LEO
ECHO.Country :>> Information.LEO
ECHO. >> Information.LEO
ECHO.Phone Numbers; >> Information.LEO
ECHO. Home :>> Information.LEO
ECHO. Personal :>> Information.LEO
ECHO. >> Information.LEO
ECHO.____________________________________________ >> Information.LEO
ECHO. >> Information.LEO
ECHO.Online >> Information.LEO
ECHO.____________________________________________ >> Information.LEO
ECHO. >> Information.LEO
ECHO.Primary Email :>> Information.LEO
ECHO.Secondary Email :>> Information.LEO
ECHO. >> Information.LEO
ECHO.Instant Messanger; :>> Information.LEO
ECHO. MSN :>> Information.LEO
ECHO. AOL :>> Information.LEO
ECHO. AIM :>> Information.LEO
ECHO. Yahoo :>> Information.LEO
ECHO. Gmail :>> Information.LEO
ECHO. >> Information.LEO
ECHO.IP Adress :>> Information.LEO
ECHO. >> Information.LEO
CD..

MKDIR School-Work
CD School-Work
ECHO. >> School-Work.LEO
ECHO.____________________________________________ >> School-Work.LEO
ECHO. >> School-Work.LEO
ECHO.School >> School-Work.LEO
ECHO.____________________________________________ >> School-Work.LEO
ECHO. >> School-Work.LEO
ECHO.School Name :>> School-Work.LEO
ECHO.School Phone :>> School-Work.LEO
ECHO.School Address :>> School-Work.LEO
ECHO.Year :>> School-Work.LEO
ECHO.Role(s) :>> School-Work.LEO
ECHO. >> School-Work.LEO
ECHO.____________________________________________ >> School-Work.LEO
ECHO. >> School-Work.LEO
ECHO.Work >> School-Work.LEO
ECHO.____________________________________________ >> School-Work.LEO
ECHO. >> School-Work.LEO
ECHO.Job Name :>> School-Work.LEO
ECHO.Work Phone :>> School-Work.LEO
ECHO.Work Address :>> School-Work.LEO
ECHO.Title :>> School-Work.LEO
CD..

CD..
MKDIR General
CD..
GOTO :1.5

:1.5
CLS
ECHO.Completed Successfully
ECHO.
PAUSE
CD Manager
CALL PM.bat

::____________________________________
::
::End Of Batch
::____________________________________


Batch Two.

::____________________________________
::
::Start Of Batch
::____________________________________


@ECHO OFF
COLOR F2
CLS


@REM Person Delete
@REM LEoH
@REM Person Manager Include

ECHO.Warning:
ECHO.Performing The Next Action
ECHO.Will Delete All Information
ECHO.About The Person You Select
ECHO.Without Confirmation.
ECHO.
ECHO.(This Deletes The Persons
ECHO.First Name Not Family Name)
ECHO.
ECHO.
PAUSE
GOTO 1

:1
CD..
COPY PM\DELTREE.exe
CLS
set /p al=Type Last Name:
set al=%al%
DIR "%al%" > nul
IF ERRORLEVEL 1 GOTO :1.2
IF NOT ERRORLEVEL 1 GOTO :1.1

:1.1
COPY DELTREE.exe "%al%"
CLS
CD "%al%"
set /p al=Type First Name:
set af=%af%
DIR "%af%" > nul
IF ERRORLEVEL 1 GOTO :2.2
IF NOT ERRORLEVEL 1 GOTO :2.1

:1.2
CLS
ECHO.An Error Has Occured.
ECHO.
PAUSE
EXIT


:2.1
CLS
DELTREE.exe /Y "%af%"
DEL DELTREE.exe /f
CD..
DEL DELTREE.exe /f
CD..
DEL DELTREE.exe /f
CD..
DEL DELTREE.exe /f
EXIT

:2.2
CLS
ECHO.An Error Has Occured.
ECHO.
PAUSE
EXIT

::____________________________________
::
::End Of Batch
::____________________________________

Thanks,
LEoH.

EDIT:
In the second batch i included DELTREE.exe witch i copied off my old system. RD wasn't doing the trick.


See More: Visual Basic 6.0

Report •


#1
April 2, 2009 at 01:57:22
you cant include a compiled batch file into vb6 project.

you have to rewrite the whole logic in vb6 code.


Report •

#2
April 2, 2009 at 03:54:49
ok, thanks.
was just wondering if there was a way to put the two together.
I guess ill just stick to the button being a link to the file. Not
that bad.

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "2.exe"


Report •

#3
April 2, 2009 at 04:46:47
I wouldn't use the WsScript shell object iether. Although it works it can almost double the size of your compiled file. The WsCript object is designed to be used with VS Script which doesnt have the facilities of VB6.

The correct way to run an external programme with VB6 is the shell command.

Shell("2.exe", 3)

The number at the end tells VB how to run the file. 3 is maximised with focus. 0 is hidden with focus which is probably what you need. The VB help files will give you all the options.

This is faster and far more efficient.

Stuart


Report •

Related Solutions

#4
April 2, 2009 at 14:17:23
Thanks.
I spent hours on the internet trying to find another way to do it.

Report •


Ask Question