Status
Not open for further replies.

silly moose

Estimable
May 31, 2014
3
0
4,510
I am somewhat new to both vbs and batch programming but i am trying to write a program that will launch a vbs message box and depending on what answer is chosen in the message box it would launch a program or do nothing. The problem is i cannot seem to find a way to write the program without having the vbs file ask you if you want command prompt to run the file after ive chosen yes. would there be some sort of way to ping variables from the vbs to the batch file?
THANKS A BUNCH
 
Solution
you don't need to mix the two, batch programming has the ability to "echo" options and then ask for an input which can then do nothing or run your program

silly moose

Estimable
May 31, 2014
3
0
4,510


i wasnt aware of that thanks
 

pauls3743

Distinguished
Dec 24, 2011
71
0
18,610
yeah this is an example of a batch file I use to load up my steam, basically it find the steam location from the registry (if it can find it), asks which username I want to load up with and then loads steam with that username. Much like yourself, I got help in creating the barebones of it but refined it through experience as well as trial and error.

@echo off

@for /f "tokens=2*" %%a in ('reg query "HKCU\software\valve\steam" /v "steamexe"') do set "steamdir=%%b"
@rem echo %steamdir%
@if not defined steamdir (
@echo.
@echo.
@echo steam cannot be found, this batch file will now exit
@pause
@exit
)
@echo 1. username1
@echo 2. username2
@echo 3. Exit
@echo.
@rem set /P uname=Select which username you would like to login with
@choice /c 123 /n /m "Select User to use"
@if errorlevel 1 set user=username1
@if errorlevel 2 set user=username2
@if errorlevel 3 exit
@start "Steam" "%steamdir%" -login %user% <password>
@rem pause


you can also use "goto" statemants combined with line markers

goto nextline


:nextline
 
Status
Not open for further replies.