@echo off :: This batch file illustrates how to create and run a script :: file from a batch file. This uses scripting to solve the :: common "How do I get user input" problem. This should work on :: Win9x and NT boxes as long as they have scripting installed! :: First test to see if we are on NT or similar OS :: The ony difference is how they handle the ampersand > ~userin.vbs echo 1234&rem type ~userin.vbs | find "rem" > nul if errorlevel 1 goto WINNT goto WIN9X :WIN9X > ~userin.vbs echo strUserIn = InputBox("Enter Data") >> ~userin.vbs echo Set fs = Wscript.CreateObject("Scripting.FileSystemObject") >> ~userin.vbs echo strFileName = fs.BuildPath(Wscript.ScriptFullName & "\..", "~userin.bat") >> ~userin.vbs echo strFileName = fs.GetAbsolutePathName(strFileName) >> ~userin.vbs echo Set ts = fs.OpenTextFile(strFileName, 2, True) >> ~userin.vbs echo ts.WriteLine "set userin=" & strUserIn >> ~userin.vbs echo ts.Close goto RUN :WINNT > ~userin.vbs echo strUserIn = InputBox("Enter Data") >> ~userin.vbs echo Set fs = Wscript.CreateObject("Scripting.FileSystemObject") >> ~userin.vbs echo strFileName = fs.BuildPath(Wscript.ScriptFullName ^& "\..", "~userin.bat") >> ~userin.vbs echo strFileName = fs.GetAbsolutePathName(strFileName) >> ~userin.vbs echo Set ts = fs.OpenTextFile(strFileName, 2, True) >> ~userin.vbs echo ts.WriteLine "set userin=" ^& strUserIn >> ~userin.vbs echo ts.Close goto RUN :RUN :: Now run the created script start /w wscript.exe ~userin.vbs del ~userin.vbs :: Now call the created batch file call ~userin.bat del ~userin.bat :: Now display the data! echo You entered %USERIN% pause cls