Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
how does this work with a menu in a batch file?
would someone write me an example for it because i cant seem to get it to work.thanks Brock
code is below
using the
'call' command to call for the vbscript file which should be in the same folder as the .bat file.in the batch file pretty much anywhere you can start the vbscript, and call another
.bat file- using @ to of course not echo the line of code -
CODE
@ start /w wscript.exe userin.vbs
@ call ~anyname.bat
@ del ~anyname.bat
now for the .vbs file : create userin.vbs using a text editor such as notepad -
CODE
strUserIn = InputBox("This is the the input box will say")
Set fs = CreateObject("Scripting.FileSystemObject")
strFileName = fs.BuildPath(Wscript.ScriptFullName & "\..", "~anyname.bat")
strFileName = fs.GetAbsolutePathName(strFileName)
Set ts = fs.OpenTextFile(strFileName, 2, True)
ts.WriteLine "set userin=" & strUserIn
ts.Close[code]Now we use what ever was typed in to execute a command.
So any dos/batch command that makes sense will fit there[code]@ Batch/doscommand -A %USERIN%

any ideas guys? i found that code online but not sure how to sure it in a batch menu for input
thanks

i need help to figure this out this code
strUserIn = InputBox("This is the the input box will say")
Set fs = CreateObject("Scripting.FileSystemObject")
strFileName = fs.BuildPath(Wscript.ScriptFullName & "\..", "~anyname.bat")
strFileName = fs.GetAbsolutePathName(strFileName)
Set ts = fs.OpenTextFile(strFileName, 2, True)
ts.WriteLine "set userin=" & strUserIn
ts.Close[code]let me have user input for a VBS but when i call it in a menu it will only just move down to the nexted line.
if i have a menu and i call that vbs for input will only GOTO the first option and if i select a different option it always goes to the first option.
but SET /p works in batch i just want to use the VBS input box. if any one can help that be great .

@echo off & setlocal
>$$$.vbs echo wsh.echo inputbox("enter something")
for /f "tokens=*" %%a in ('cscript//nologo $$$.vbs') do set var=%%a
echo.%var%

Kinda off topic but do you know how to use a VBS yes no and have it work with goto commands in batch?

![]() |
convert yyyy/d/m to yyyy/...
|
c programing
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |