China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-03 17:11
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] How to generate a checkbox on a web page and return it to the CMD according to the user's selection View 2,253 Replies 27
Floor 16 Posted 2007-03-07 14:13 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
The file links in the IE interface window generated by VBS can only use absolute addresses for connection, so it is not very suitable to use multiple html files to form the interface.

Your interface seems to require each selected software to go through a separate interface configuration for installation, which is relatively cumbersome. It is suggested that green software be made into a green installation version with WinRAR and that's it.

The script on my 14th floor can be appropriately added with some code to add software descriptions, default software that needs to be installed, etc. in the interface; try to be as simple as possible.
Floor 17 Posted 2007-03-07 21:51 ·  中国 广东 东莞 电信
银牌会员
★★★
Credits 1,179
Posts 442
Joined 2006-09-09 22:47
19-year member
UID 62249
Status Offline
Originally posted by zh159 at 2007-3-7 14:13:
The file links in the IE interface window generated by VBS can only use absolute addresses, so it is not very suitable to use multiple html files to form the interface

Your interface seems to require each selected software to go through a separate ...


My installation is made with BAT + VBS + HTML. Because the code I provided is the VBS code generated by BAT, of course there is no content of BAT. VBS will return the result to BAT, and then use BAT + RAR to decompress and install or directly call the EXE program.
There are 4 installation methods I provided. The first one is the conventional method, which can not only be used to install green software, but also install ordinary EXE files. If it is a green software compressed by WINRAR or 7ZIP, it will be directly decompressed, and finally the GSETUP.BAT in the installation directory (indicating the batch processing program of each green software) is executed to complete the installation; the second one only installs the specially made WINRAR compressed package. How is it special? In fact, it is to automatically call the GSETUP.BAT inside when decompressing the green software when compressing the green software, so as to simplify the installation process. Most of my green software is in this mode, which is relatively convenient. It can be installed manually or use the RAR command to decompress and install. The third method means to repair the installed green software. The reason is very simple. If the system is reinstalled, the original green software can not be used anymore, then this repair function can be simply used, and the GSETUP.BAT existing in the specified directory is automatically traversed and executed. The fourth one is to directly traverse the UINSTALL.BAT in the specified directory to delete the green software. Because my title is "One-click Installation Manager", so all operations reflect this theme, and the user does not need to participate too much.

If the InStallList.txt file exists in the program directory, the program will automatically call the file and list it on the IE interface for the user to choose. If it does not exist, I provide two options. One is to directly traverse all EXE, RAR, 7Z files in the directory, and automatically add the installation instructions of the software according to the comments of the compressed file (it needs to be set well when making the compressed file). If not, keep it as an empty table; the other is to provide a button to make the installation script. The user can directly click to generate and automatically generate the InStallList.txt file according to the comments of the compressed file, then the user can modify the installation instructions in InStallList.txt, and the speed will be greatly improved when reloading.


The purpose of making this program is because I am a computer administrator. I not only often install programs for the company (many large programs such as OFFICE and so on I have made into green versions), but also often install programs for colleagues and friends. Then I wrote this program, and installing software has become very simple. Just copy all my green software over, and the user can install it by himself, without me running around.

Thank you, Brother ZH, for your great support. Ask, I am not satisfied with only the interface now. Is there really no way to solve it? To fix the head and tail, can it be realized by the method of 13th floor? This is the code given by others, but no matter how I do it, it doesn't work. Is there any other way? Can I use IFRAME? Because as long as I put the IFRAME in the middle, set the appropriate height and width, and don't care about the head and tail, so it should be realized, but I don't know how to do it?

In the process of making this program this time, since I basically have no contact with VBS and HTML before, it is relatively difficult. In the process of learning your program, I found a lot of interesting things, and through continuous simulation and testing, I found the following things are very useful: >>%Temp%\Temp.vbs echo Wscript.Echo .IPATH.value is not easy to use, then I can modify it to >>%Temp%\Temp.vbs echo Wscript.Echo "SET IPATH="+.IPATH.value That is to say, when using Wscript.Echo to return the variable to CMD, I can directly attach the syntax and commands of CMD. In this way, when using the FOR statement to obtain the variable, there is no need to carry out in different situations. Just use for /f "delims=" %%i in ('"cscript //nologo %Temp%\Temp.vbs"') do ( CALL %%i) A sentence can be easily done. I found that commands such as GOTO, ECHO, etc. can all be attached to Wscript.Echo. When making the HTML page, give the check box, option group, etc. the same name, and then use FOR to loop and detect very conveniently and effectively.

In addition, referring to your program, I found that it directly generates the HTML file in memory. If this is the case, then using FRAME or IFRAME to call in the memory address (I checked the help, it is said that it can be connected or anchored through the relative address), it seems quite difficult; and the DEBUG assembly program that generates the background is very interesting, I don't know what the principle is.

[ Last edited by HUNRYBECKY on 2007-3-7 at 10:22 PM ]
Floor 18 Posted 2007-03-07 22:50 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
I also learned to use >>%Temp%\Temp.vbs echo Wscript.Echo "SET IPATH="+.IPATH.value later. The list file directly generates an "InStallList.htm" file, and you can call the absolute address in the IFRAME (I tried relative addresses and couldn't find the file, so I had to use CMD to generate the absolute address).

>>List.vbs echo .write "<iframe width=420 height=400 src='%cd%\InStallList.htm'></iframe>"
In HTML, the symbols "/" and "\" for paths are not distinguished.
Floor 19 Posted 2007-03-07 23:25 ·  中国 广东 东莞 电信
银牌会员
★★★
Credits 1,179
Posts 442
Joined 2006-09-09 22:47
19-year member
UID 62249
Status Offline
Thanks, I'll test it out. But I'm very busy today. I'll reply you when I get the result. Thanks again, Brother ZH.
Floor 20 Posted 2007-03-08 09:55 ·  中国 广东 东莞 电信
银牌会员
★★★
Credits 1,179
Posts 442
Joined 2006-09-09 22:47
19-year member
UID 62249
Status Offline
Originally posted by zh159 at 2007-3-7 22:50:
I also learned to use >>%Temp%\Temp.vbs echo Wscript.Echo "SET IPATH="+.IPATH.value later on this part of "that >>%Temp%\Temp.vbs echo Wscript.Echo .IPATH.value"

The list file is directly generated...


Brother ZH, I experimented tonight, and there are mainly two aspects of problems. First, how to generate an HTML file for calling in an IFRAME. I found that I can't directly use the WRITE method because this directly writes to the current IE window and can't write to a file. I used >d:\ok.htm echo <body>, but ECHO can't handle symbols like > and < in HTML. If I add quotes, that is >d:\ok.htm echo "<body>", then many "" will be generated in IE, which is not nice. I used the Scripting.FileSystemObject method, although it can solve the problem, but antivirus software installed will all prompt for unsafe scripts and kill them. Is there a good method?
Second, the HTM called in the IE window generated by VBS in <iframe> is always blank. I don't know what's going on. I call other HTTP addresses and it's also empty. But when I call it in other HTML files, it's normal. Is it that using WRITE to write to the current IE window through VBS can't use IFRAME? It's really strange.

[ Last edited by HUNRYBECKY on 2007-3-8 at 10:11 AM ]
Floor 21 Posted 2007-03-08 12:29 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
I tried it, and it seems that VBS doesn't support the property of selecting items within the iframe frame. In that case, it can only be made into a single HTML list file.
Floor 22 Posted 2007-03-09 02:58 ·  中国 广东 东莞 电信
银牌会员
★★★
Credits 1,179
Posts 442
Joined 2006-09-09 22:47
19-year member
UID 62249
Status Offline
Originally posted by zh159 at 2007-3-8 12:29:
Tried it, VBS doesn't seem to support the selection item properties within the iframe frame. In this case, it can only be made into a single html list file


This is quite troublesome. Hehe, the first problem is also relatively troublesome. I don't know if the problem of < > special characters can be solved.
Floor 23 Posted 2007-03-09 05:13 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
If it is a single HTML file, you can first write it as VBS, so that you don't have to worry about the problem of <> symbols.

<> symbols are written in the way of ^<^>
Floor 24 Posted 2007-03-09 08:05 ·  中国 广东 东莞 电信
银牌会员
★★★
Credits 1,179
Posts 442
Joined 2006-09-09 22:47
19-year member
UID 62249
Status Offline
Originally posted by zh159 at 2007-3-9 05:13:
If it is a single HTML file, you can first write it as VBS, so that you don't have to worry about the problem of <> symbols

Use ^<^> to write <> symbols



Why add the ^ symbol? It's for escaping, right, but there are many of them. Haha. That's a lot of work. It seems that VBS can only write directly to the screen. How to write a single file? Using Scripting.FileSystemObject is possible, but antivirus software always intercepts it. Is there any other way for VBS? Thanks, Brother ZH.

[ Last edited by HUNRYBECKY on 2007-3-9 at 08:09 AM ]
Floor 25 Posted 2007-03-09 13:19 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
```
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
for /l %%i in (1,1,9) do (set menu%%i= )
:menu
echo ... %msg%
echo 1.sw.exe 2.sw.exe
echo 3.sw.exe 4.sw.exe

echo.
echo installation check all quit

echo.
set /p xx="SYSTEM\installation command>"
set xx=%xx:~0,1%
if /i %xx%] == i] goto install
if /i %xx%] == a] (for /l %%i in (1,1,9) do set menu%%i=X)&&cls&&goto menu
if /i %xx%] == q] exit/b
echo %xx%|findstr /v >nul&&cls&&set msg= "%xx%" input error!&&goto menu||set msg= &&if /i







Floor 26 Posted 2007-03-10 01:47 ·  中国 广东 东莞 电信
银牌会员
★★★
Credits 1,179
Posts 442
Joined 2006-09-09 22:47
19-year member
UID 62249
Status Offline
这个与我的问题有关吗?看了半天也没有什么关系呀。

Is this related to my question? I've looked at it for a long time and it doesn't seem related at all.
Floor 27 Posted 2007-03-13 06:36 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
Hehe, the HTML method is too complicated. I thought of a simpler one for you
Floor 28 Posted 2007-03-13 09:26 ·  中国 广东 东莞 电信
银牌会员
★★★
Credits 1,179
Posts 442
Joined 2006-09-09 22:47
19-year member
UID 62249
Status Offline
Originally posted by everest79 at 2007-3-13 06:36:
Hey, the HTML method is too complicated. I came up with a simpler one for you.



As long as you study it carefully, it's not too complicated. I used to be in the CMD version too, but there was no interface. After seeing Brother ZH159's post about someone saying batch processing interfaces aren't beautiful, I also wanted to learn along, so I modified the HTML version. In the end, I combined the two versions.
Forum Jump: