Getting User Input

看板EZsoft (小軟體)作者 (KCda260)時間18年前 (2007/12/14 03:07), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/1
很有趣的方法 給喜歡玩Windows Scripting & batch user Windows Scripting If you have Win98, NTSP4, or something newer, you should have Windows Scripting. If you don't have it, download it. Here I show a batch file that runs a pre-built visual basic script "userin.vbs". That script, when run, will create a simple one-line batch file "~userin.bat" which puts the user input into the environment. Because this is a batch web page and not a scripting web page, all you'll get is the sample script with no explanation... Here is the batch file: start /w wscript.exe userin.vbs call ~userin.bat del ~userin.bat echo You entered %USERIN% Now the script file I call "userin.vbs" strUserIn = InputBox("Enter Data") Set fs = CreateObject("Scripting.FileSystemObject") strFileName = fs.BuildPath(Wscript.ScriptFullName & "\..", "~userin.bat") strFileName = fs.GetAbsolutePathName(strFileName) Set ts = fs.OpenTextFile(strFileName, 2, True) ts.WriteLine "set userin=" & strUserIn ts.Close -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 122.121.65.240 KCda260:轉錄至看板 Programming 12/14 03:08

12/14 15:51, , 1F
這可以用在哪阿??
12/14 15:51, 1F
文章代碼(AID): #17OOBi-d (EZsoft)
文章代碼(AID): #17OOBi-d (EZsoft)