• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.
  • The forums have been upgraded with support for dark mode. By default it will follow the setting on your system/browser. You may override it by scrolling to the end of the page and clicking the gears icon.

Visual Basic 6 help

Joined
Aug 29, 2005
Messages
7,524 (1.05/day)
Location
Stuck somewhere in the 80's Jpop era....
System Name Lynni PS \ Lenowo TwinkPad L14 G2
Processor AMD Ryzen 7 7700 Raphael \ i5-1135G7 Tiger Lake-U
Motherboard ASRock B650M PG Riptide Bios v. 3.10 AMD AGESA 1.2.0.2a \ Lenowo BDPLANAR Bios 1.68
Cooling AMD Wraith Cooler \ Lenowo C-267C-2
Memory G.Skill Flare X5 2x16GB DDR5 6000MHZ CL36-36-36-96 AMD EXPO \ Willk Elektronik 2x16GB 2666MHZ CL17
Video Card(s) Sapphire PURE AMD Radeon™ RX 9070 Gaming OC 16GB | Intel® Iris® Xe Graphics
Storage Gigabyte M30 1TB|Sabrent Rocket 2TB| HDD: 10TB|1TB \ WD RED SN700 1TB
Display(s) KTC M27T20S 1440p@165Hz | LG 48CX OLED 4K HDR | Innolux 14" 1080p
Case Asus Prime AP201 White Mesh | Lenowo L14 G2 chassis
Audio Device(s) Steelseries Arctis Pro Wireless
Power Supply Be Quiet! Pure Power 12 M 750W Goldie | Cyberpunk GaN 65W USB-C charger
Mouse Logitech G305 Lightspeedy Wireless | Lenowo TouchPad & Logitech G305
Keyboard Ducky One 3 Daybreak Fullsize | L14 G2 UK Lumi
Software Win11 IoT Enterprise 24H2 UK | Win11 IoT Enterprise LTSC 24H2 UK / Arch (Fan)
Benchmark Scores 3DMARK: https://www.3dmark.com/3dm/89434432? GPU-Z: https://www.techpowerup.com/gpuz/details/v3zbr
i am trying to make a custom menu or what u will call it, for work so i can combined Office 2013 OEM Danish and English 32bit onto on disc it looks like this:

Capture.JPG



and i use this code in the:

Code:
Private Sub Command1_Click(Index As Integer)
Shell "C:\Office 2013 DAN-ENG\DA-da\setup.exe"
End Sub

Private Sub Command2_Click()
Shell "C:\Office 2013 DAN-ENG\EN-en\setup.exe"
End Sub


i want it to excuse the original setup.exe for Office 2013 32bit in the folder path, when it's burned out the path will ofc be "\DA-da\setup.exe" and "\EN-en\setup.exe" if i am not wrong.

can anyone tell me what i am doing wrong, bcs when i click on the buttons atm i get this message:

Office.2013.error.jpg
 
Remove "C:\Office 2013 DAN-ENG" from the path?
 
that leads to this:

test.run-time.error.53.jpg



to make it clear, i am not a Visual Basic expert, this is my first day using this program x:
 
I would use something newer. VB 6 is pretty old. You should be able to get the latest express edition of Visual Basic .NET off Microsoft's website. You should use something like that instead IMHO. Personally, I would use C# if I was going to develop for Windows but, that's me.

http://www.microsoft.com/visualstudio/eng/downloads#d-2012-express
 
I would use something newer. VB 6 is pretty old. You should be able to get the latest express edition of Visual Basic .NET off Microsoft's website. You should use something like that instead IMHO. Personally, I would use C# if I was going to develop for Windows but, that's me.

http://www.microsoft.com/visualstudio/eng/downloads#d-2012-express

i need to be able to run this even without having C++ installed, dunno if Visual Basic is the thing to use then or not. This here is kinda of my own project at work i have started...
 
Try just "EN-en\setup.exe"
 
Try it like this """C:\Office 2013 DAN-ENG\DA-da\setup.exe""" for both
 
with 3x """ in front and back? O.o
 
Backslashes need to be escaped iirc. It should look like:

"C:\\Directory\\to\\some\\path\\file.exe"
 

still don't work :/

but i think it's may be the setup file i am using to be honest.

bcs i just tried another setup.exe file and it starts perfectly.
 
so now i need to find away to make it run from ISO file, bcs if i type C:\blahblah\blahblah\setup.exe it will search the hdd not the iso file :/
 
not working either so i dunno
That should have worked assuming the executable is running from the directory above them both (at C:\Office 2013 DAN-ENG\APP.EXE). Visual Studio may be executing from a location you're not expecting it to be executing from.


Edit: I would recommend "burning" to an ISO, then mounting the ISO to test. Don't waste a disk until you're sure it works.


Edit: It may also help to set the working directory when launching the executable. Relative paths are based on the working directory.
 
Last edited:
Try this C:\Office%2013%DAN-ENG\DA-da\setup.exe or "C:\Office%2013%DAN-ENG\DA-da\setup.exe"
 
Try :

Code:
Private Sub Command1_Click(Index As Integer)
Shell "\Office 2013 DAN-ENG\DA-da\setup.exe"
End Sub

or :

Code:
Private Sub Command1_Click(Index As Integer)
Shell """\Office 2013 DAN-ENG\DA-da\setup.exe"""
End Sub
 
well i need to get it to run from a ISO file so i don't need "C:\Office 2013 DAN-ENG\"
 
well i need to get it to run from a ISO file so i don't need "C:\Office 2013 DAN-ENG\"

Ahh ok... When using shell and you want to find out where a file lives then use "%~dp0".

Try this code

Code:
Private Sub Command1_Click(Index As Integer)
Shell "%~dp0\DA-da\setup.exe"
End Sub

Private Sub Command2_Click()
Shell "%~dp0\EN-en\setup.exe"
End Sub

EDIT: In VB6 you can do this:
Code:
App.Path & IIf(Right$(App.Path, 1) <> "\", "\", "") & App.EXEName & ".exe"
So, you would need to do
Code:
App.Path & IIf(Right$(App.Path, 1) <> "\", "\", "") & "DA-da\setup.exe"


Here is how I would use it.

Example:
Code:
[/B]Private Sub Command1_Click()

Dim drive As String
drive = App.Path & IIf(Right$(App.Path, 1) <> "\", "\", "") & "DA-da\setup.exe"

Shell "cmd /C " & drive, vbNormalFocus
Shell "Taskkill /IM cmd.exe"

End Sub
 
Last edited:
Alternatively, you could just make the application with VB.NET, make a setup for it that includes the .NET installer, and use autorun.inf to point to the setup.

Windows Vista and newer have at least .NET Framework 2.0 preinstalled. Only XP and older don't have .NET unless the user opt'd in for it at Windows Update.
 
Alternatively, you could just make the application with VB.NET, make a setup for it that includes the .NET installer, and use autorun.inf to point to the setup.

Windows Vista and newer have at least .NET Framework 2.0 preinstalled. Only XP and older don't have .NET unless the user opt'd in for it at Windows Update.

Yea I agree, VB.net would be more ideal than vb6. :toast:
 
which VB version? 2010 or 2012? bcs i can get Visual Basic 2010 / 2012 Express...
 
which VB version? 2010 or 2012? bcs i can get Visual Basic 2010 / 2012 Express...

It depends.. If you need your program to work on Windows XP or later then 2010. If not then 2012. I have 2012 installed on one of my Windows 8 boxes, but I don't use it as much. Did you not try what I suggested above? I have Visual Studio 6 on a VM. So, I loaded up the VM and tested my code above and it works. I'm with Ford and think you should move over to .net, but your transition my take a week or two. If you need this to work now, then I would suggest you finish this project in VB6. Once you get the hang of .net then re code it in .net. :toast:
 
Back
Top