vbs to batch

silly moose

Estimable
May 31, 2014
3
0
4,510
0
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
 

pauls3743

Distinguished
Dec 24, 2011
71
0
18,610
16
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
0


i wasnt aware of that thanks
 

pauls3743

Distinguished
Dec 24, 2011
71
0
18,610
16
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
 
Thread starter Similar threads Forum Replies Date
David___Only Apps General Discussion 0
S Apps General Discussion 4
M Apps General Discussion 3
D Apps General Discussion 2
N Apps General Discussion 1
NoctisLionward Apps General Discussion 2
malavena Apps General Discussion 3
Tom Waller Apps General Discussion 2
P Apps General Discussion 1
S Apps General Discussion 4
A Apps General Discussion 13
Z Apps General Discussion 1
P Apps General Discussion 7
G Apps General Discussion 0
T Apps General Discussion 5
SHADOWSTRIKE1 Apps General Discussion 3
S Apps General Discussion 3
R Apps General Discussion 3
P Apps General Discussion 2
M Apps General Discussion 3

ASK THE COMMUNITY