|
HUNRYBECKY
银牌会员
    
积分 1179
发帖 442
注册 2006-9-9
状态 离线
|
『楼 主』:
[求助]如何产生网页的复选框并根据用户选择返回给CMD
使用 LLM 解释/回答一下
首先祝大家新年快乐,健康平安幸福每一天
今天无聊没有事情,就跑来上网,想问个问题:批量安装绿色软件
我使用FOR /F "DELIMS=" %% I IN ('DIR /S/B *G.EXE') DO ECHO %%I 来获取了所有需要安装的绿色软件(后面最后一个字符为G的EXE文件)路径,虽然获取了绿色软件,但是我想让用户根据这个列表来选择安装,怎么实现呢?纯DOS好像不行,我想通过使用CMD产生一个HTML文件,因为HTML文件中可以使用复选框,用户就可以根据这个复选框来选择安装那些软件了,但是如何实现呢?我对HTML编程一窍不通哟,所以只有请各位大哥多多发表下意见(以前看到"谁说批处理界面不漂亮,就想要这样的效果").
我的批处理内容如下(注意IPATH是预先在RAR压缩时使用的解压路径,可以在批处理中设置RAR可以识别):
@echo off
SET PATH=%CD%;%CD%\TOOLS\;%PATH%
SET /P IPATH=请你输入安装路径(如D:;e:\greensoft,输入时省去最后一个\):
CLS
FOR /F "DELIMS=" %%I IN ('DIR /S/B *G.exe') DO (
IF NOT EXIST "%IPATH%\%%~nI" (
SET IPATH=%IPATH%\%%~nI
ECHO 正在安装%%~nI到%IPATH%下,请等待......
START /B/WAIT/MIN "" %%I)
)
PAUSE
Last edited by HUNRYBECKY on 2007-2-28 at 05:02 AM ]
First of all, I wish everyone a happy new year, good health, peace and happiness every day.
Today I'm bored with nothing to do, so I come online and want to ask a question: batch installation of green software.
I used FOR /F "DELIMS=" %%I IN ('DIR /S/B *G.EXE') DO ECHO %%I to obtain the paths of all green software that need to be installed (the EXE files whose last character is G at the end). Although I obtained the green software, I want users to select and install according to this list. How to achieve it? Pure DOS seems not possible. I want to generate an HTML file through CMD because checkboxes can be used in HTML files, and users can select which software to install according to these checkboxes. But how to achieve it? I know nothing about HTML programming. So I can only ask you brothers to give more opinions. (I saw before "Who said that the batch processing interface is not beautiful, and I want such an effect.")
My batch processing content is as follows (note that IPATH is the decompression path used in the RAR compression in advance, and can be set in the batch processing to make RAR recognizable):
@echo off
SET PATH=%CD%;%CD%\TOOLS\;%PATH%
SET /P IPATH=Please enter the installation path (such as D:;e:\greensoft, omit the last \ when entering):
CLS
FOR /F "DELIMS=" %%I IN ('DIR /S/B *G.exe') DO (
IF NOT EXIST "%IPATH%\%%~nI" (
SET IPATH=%IPATH%\%%~nI
ECHO Is installing %%~nI to %IPATH% below, please wait......
START /B/WAIT/MIN "" %%I)
)
PAUSE
Last edited by HUNRYBECKY on 2007-2-28 at 05:02 AM ]
|
|
2007-2-19 23:06 |
|
|
HUNRYBECKY
银牌会员
    
积分 1179
发帖 442
注册 2006-9-9
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
好像今天人很少,自己顶下.
It seems there are very few people today, so I'll bump it myself.
|
|
2007-2-19 23:25 |
|
|
HUNRYBECKY
银牌会员
    
积分 1179
发帖 442
注册 2006-9-9
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
在顶下,以前的那个漂亮的IE界面的帖子好像也被删除了。想下载下来学习也不行了。
Under the top, the previous post about the beautiful IE interface seems to have been deleted. It's not possible to download it for learning.
|
|
2007-2-20 00:07 |
|
|
HUNRYBECKY
银牌会员
    
积分 1179
发帖 442
注册 2006-9-9
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
恩,继续在等待,今天好像问问题的比较多,高手都回家过年了 :-)
Well, still waiting. It seems there are more people asking questions today. The experts have all gone home for the New Year :-)
|
|
2007-2-20 02:54 |
|
|
HUNRYBECKY
银牌会员
    
积分 1179
发帖 442
注册 2006-9-9
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
可能我表达的不是很清楚,说明一下.
我使用FOR命令获取到了要安装的绿色软件列表到一个文本OK.TXT
PowerwordG.exe
winrarG.exe
QQG.exe
我想根据OK.TXT的文件内容让用户选择安装需要安装的绿色软件,但是直接在CMD下比较麻烦而且不是很美观,所以我想使用网页的形式如像"谁说的批处理界面不漂亮"一样,根据OK.TXT的项目产生一系列复选框,然后用户就可以自由选择了,然后把用户的选择返回给CMD.
不知道我这样表达是否清楚了.
这里有效果的例子:http://www.blabla.cn/html_examples/056_form_input_check_checked.html
Last edited by HUNRYBECKY on 2007-2-28 at 04:51 AM ]
Maybe I didn't express it very clearly, let me explain.
I used the FOR command to obtain the list of portable software to be installed into a text file OK.TXT
PowerwordG.exe
winrarG.exe
QQG.exe
I want to let the user choose which portable software to install according to the content of OK.TXT, but it's cumbersome and not very beautiful directly in CMD, so I want to use a web form like "Who said batch processing interface is not beautiful" to generate a series of checkboxes according to the items in OK.TXT, then the user can choose freely, and then return the user's choice to CMD.
I don't know if I have made it clear like this.
Here is an effective example: http://www.blabla.cn/html_examples/056_form_input_check_checked.html
Last edited by HUNRYBECKY on 2007-2-28 at 04:51 AM ]
|
|
2007-2-27 23:36 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
要用html那就不知道了
If it's about HTML, then I don't know.
|
|
2007-2-27 23:53 |
|
|
HUNRYBECKY
银牌会员
    
积分 1179
发帖 442
注册 2006-9-9
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
恩,ZH159兄的哪个谁说批处理不漂亮,就是使用BAT+VBS+HTML实现的,效果相当不错,但是本人不会HTML的语法,所以比较麻烦.希望会HTML的高手来解答
Well, Brother ZH159 said that someone said batch processing is not beautiful. It is implemented using BAT + VBS + HTML, and the effect is quite good. But I don't know the HTML syntax, so it's more troublesome. I hope experts who know HTML can answer.
|
|
2007-2-28 00:39 |
|
|
HUNRYBECKY
银牌会员
    
积分 1179
发帖 442
注册 2006-9-9
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
一直没有人来回答.是不是有点难,还是其他原因,路过走过的,给点意见.
There has been no one to answer. Is it a bit difficult, or for other reasons? Those who pass by, give some opinions.
|
|
2007-2-28 05:03 |
|
|
zh159
金牌会员
     
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
现在忙,等过几天有空了再写一段
I'm busy now. I'll write a paragraph when I have free time a few days later.
|
|
2007-2-28 11:43 |
|
|
HUNRYBECKY
银牌会员
    
积分 1179
发帖 442
注册 2006-9-9
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
谢谢.理解.不过我现在正研究你的哪个程序
Thanks. Understand. But which program of yours am I researching now
|
|
2007-3-1 00:41 |
|
|
slore
铂金会员
      
积分 5212
发帖 2478
注册 2007-2-8
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
Originally posted by HUNRYBECKY at 2007-2-27 11:39:
恩,ZH159兄的哪个谁说批处理不漂亮,就是使用BAT+VBS+HTML实现的,效果相当不错,但是本人不会HTML的语法,所以比较麻烦.希望会HTML的高手来解答
严格的说那是P处理么?调用了……
那个纯粹是个IE界面…罢了。单P可以么?
P可以运行exe,运行个cs,qq,war3的话,不知道可不可以说批处理能对战?能视频……能XXX……
Originally posted by HUNRYBECKY at 2007-2-27 11:39:
Well, someone from Brother ZH159 said that batch processing is not beautiful. It is implemented using BAT + VBS + HTML, and the effect is quite good. However, I don't know the HTML syntax, so it's more troublesome. I hope experts who know HTML can answer.
Strictly speaking, is that batch processing? It calls...
That's just an IE interface... that's all. Can a single batch be used?
Batch can run exe. I don't know if it can be said that batch processing can be used for battle, video... and so on when running a cs, qq, war3.
|
|
2007-3-1 01:35 |
|
|
zh159
金牌会员
     
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
批处理本来就是一个命令(内部命令、外部命令)的集合体,调用各种命令来完成目的任务。
Batch processing is originally a collection of commands (internal commands, external commands), and various commands are called to complete the intended tasks.
|
|
2007-3-1 02:23 |
|
|
HUNRYBECKY
银牌会员
    
积分 1179
发帖 442
注册 2006-9-9
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
问下能不能使用FRAME把网页划分为三个部分,第一个部分为页头,大小规定,显示重要显示,而第二个部分内容,根据内容的多少显示滚动条;第三个部分为页尾,显示其他信息,如何在VBS中实现?
如下面的代码,我怎样直接在FRAME的LEFT中写入文本,却没有任何效果:
<html>
<head>
<frameset cols="50%,50%">
<frame name="left" src="">
<frame name="right" src="">
</frameset>
<script language="javascript">
function window.onload()
{
document.frames.item("left").document.write("11111");
document.frames.item("left").document.close();
}
</script>
</head>
</html>
Last edited by HUNRYBECKY on 2007-3-4 at 03:41 AM ]
Ask if it is possible to use FRAME to divide a web page into three parts. The first part is the page header, with a specified size and showing important information. The second part is the content, which displays a scrollbar according to the amount of content. The third part is the page footer, displaying other information. How to implement this in VBS?
For the code below, why does writing text directly in the LEFT of FRAME have no effect:
<html>
<head>
<frameset cols="50%,50%">
<frame name="left" src="">
<frame name="right" src="">
</frameset>
<script language="javascript">
function window.onload()
{
document.frames.item("left").document.write("11111");
document.frames.item("left").document.close();
}
</script>
</head>
</html>
Last edited by HUNRYBECKY on 2007-3-4 at 03:41 AM ]
|
|
2007-3-4 00:31 |
|
|
zh159
金牌会员
     
积分 3687
发帖 1467
注册 2005-8-8
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
你这个还得需要两个html文件连接到
<frame name="left" src="html文件1">
<frame name="right" src="html文件2">
中才有效
写段简单些的(自己删除二句“goto min”,把后面的 call echo start /w "%%%%i%%" 改为 call start /w "%%%%i%%")
@echo off
goto min
mode con cols=25 lines=5
%1 %2
start /min /i "" "%~nx0" goto min&&exit
:min
if exist *.exe (
for /f "delims=" %%i in ('dir /on/a-d/b *.exe') do (
set /a Num+=1
call set "file%%Num%%=%%i"
))
>List.vbs echo set WshShell = Wscript.CreateObject("Wscript.Shell")
>>List.vbs echo set ie=wscript.createobject("internetexplorer.application","event_")
>>List.vbs echo ie.menubar=0
>>List.vbs echo ie.addressbar=0
>>List.vbs echo ie.toolbar=0
>>List.vbs echo ie.statusbar=0
>>List.vbs echo ie.resizable=0
>>List.vbs echo ie.width=600
>>List.vbs echo ie.height=600
>>List.vbs echo ie.navigate "about:blank"
>>List.vbs echo ie.left=fix((ie.document.parentwindow.screen.availwidth-ie.width)/2)
>>List.vbs echo ie.top=fix((ie.document.parentwindow.screen.availheight-ie.height)/2)
>>List.vbs echo ie.visible=1
>>List.vbs echo with ie.document
>>List.vbs echo .write "<html><title>安装列表</title><body background='bg.gif' bgcolor=#e3e5da style='font-family:楷体_GB2312;font-size:24px;' scroll=yes><p align=center>软件列表"
>>List.vbs echo .write "<table width=500 align=center border=1 cellSpacing=2 cellpadding=4 borderColor=#698cc2 style='font-family:宋体;font-size:15px;border:#698cc2 2px solid;'>"
>>List.vbs echo .write "<tr align=center><td width=45><b>序号</b></td><td><b>软 件 名 称</b></td></tr>"
if exist *.exe (
for /l %%n in (1,1,%Num%) do >>List.vbs call echo .write "<tr><td align=center><b>%%n</b></td><td><input id=file%%n type=checkbox style=cursor:hand><label for=file%%n style=cursor:hand><b>安装 “%%file%%n%%”</b></label></td></tr>"
) else (
>>List.vbs echo .write "<tr align=center><td width=45><b>无</b></td><td colspan=2><b>本目录没有 EXE 安装程序</b></label></td></tr>"
)
>>List.vbs echo .write "</table><p align=center><input id=confirm type=submit value='开始安装'></td></table></body></html>"
>>List.vbs echo end with
>>List.vbs echo dim wmi
>>List.vbs echo set wnd=ie.document.parentwindow
>>List.vbs echo set id=ie.document.all
>>List.vbs echo id.confirm.onclick=getref("confirm")
>>List.vbs echo do while true
>>List.vbs echo wscript.sleep 500
>>List.vbs echo WshShell.AppActivate ("安装列表 - Microsoft Internet Explorer")
>>List.vbs echo loop
>>List.vbs echo sub event_onquit
>>List.vbs echo ie.visible=0
>>List.vbs echo wscript.quit
>>List.vbs echo end sub
>>List.vbs echo sub confirm
>>List.vbs echo ie.visible=0
>>List.vbs echo ie.quit
>>List.vbs echo with id
if exist *.exe for /l %%n in (1,1,%Num%) do >>List.vbs echo if .file%%n.checked then Wscript.Echo "file%%n"
>>List.vbs echo wscript.quit
>>List.vbs echo exit sub
>>List.vbs echo end with
>>List.vbs echo end sub
for /f "delims=" %%i in ('"cscript //nologo List.vbs"') do call echo start /w "%%%%i%%"
del List.vbs
exit
Last edited by zh159 on 2007-3-3 at 09:24 PM ]
This still needs to be connected to two HTML files in
<frame name="left" src="HTML file 1">
<frame name="right" src="HTML file 2">
to be effective
Write something simpler (delete two lines "goto min" by yourself, and change the following call echo start /w "%%%%i%%" to call start /w "%%%%i%%")
@echo off
goto min
mode con cols=25 lines=5
%1 %2
start /min /i "" "%~nx0" goto min&&exit
:min
if exist *.exe (
for /f "delims=" %%i in ('dir /on/a-d/b *.exe') do (
set /a Num+=1
call set "file%%Num%%=%%i"
))
>List.vbs echo set WshShell = Wscript.CreateObject("Wscript.Shell")
>>List.vbs echo set ie=wscript.createobject("internetexplorer.application","event_")
>>List.vbs echo ie.menubar=0
>>List.vbs echo ie.addressbar=0
>>List.vbs echo ie.toolbar=0
>>List.vbs echo ie.statusbar=0
>>List.vbs echo ie.resizable=0
>>List.vbs echo ie.width=600
>>List.vbs echo ie.height=600
>>List.vbs echo ie.navigate "about:blank"
>>List.vbs echo ie.left=fix((ie.document.parentwindow.screen.availwidth-ie.width)/2)
>>List.vbs echo ie.top=fix((ie.document.parentwindow.screen.availheight-ie.height)/2)
>>List.vbs echo ie.visible=1
>>List.vbs echo with ie.document
>>List.vbs echo .write "<html><title>Installation List</title><body background='bg.gif' bgcolor=#e3e5da style='font-family:SimSun-GB2312;font-size:24px;' scroll=yes><p align=center>Software List"
>>List.vbs echo .write "<table width=500 align=center border=1 cellSpacing=2 cellpadding=4 borderColor=#698cc2 style='font-family:SimSun;font-size:15px;border:#698cc2 2px solid;'>"
>>List.vbs echo .write "<tr align=center><td width=45><b>Serial Number</b></td><td><b>Software Name</b></td></tr>"
if exist *.exe (
for /l %%n in (1,1,%Num%) do >>List.vbs call echo .write "<tr><td align=center><b>%%n</b></td><td><input id=file%%n type=checkbox style=cursor:hand><label for=file%%n style=cursor:hand><b>Install “%%file%%n%%”</b></label></td></tr>"
) else (
>>List.vbs echo .write "<tr align=center><td width=45><b>None</b></td><td colspan=2><b>No EXE installation program in this directory</b></label></td></tr>"
)
>>List.vbs echo .write "</table><p align=center><input id=confirm type=submit value='Start Installation'></td></table></body></html>"
>>List.vbs echo end with
>>List.vbs echo dim wmi
>>List.vbs echo set wnd=ie.document.parentwindow
>>List.vbs echo set id=ie.document.all
>>List.vbs echo id.confirm.onclick=getref("confirm")
>>List.vbs echo do while true
>>List.vbs echo wscript.sleep 500
>>List.vbs echo WshShell.AppActivate ("Installation List - Microsoft Internet Explorer")
>>List.vbs echo loop
>>List.vbs echo sub event_onquit
>>List.vbs echo ie.visible=0
>>List.vbs echo wscript.quit
>>List.vbs echo end sub
>>List.vbs echo sub confirm
>>List.vbs echo ie.visible=0
>>List.vbs echo ie.quit
>>List.vbs echo with id
if exist *.exe for /l %%n in (1,1,%Num%) do >>List.vbs echo if .file%%n.checked then Wscript.Echo "file%%n"
>>List.vbs echo wscript.quit
>>List.vbs echo exit sub
>>List.vbs echo end with
>>List.vbs echo end sub
for /f "delims=" %%i in ('"cscript //nologo List.vbs"') do call echo start /w "%%%%i%%"
del List.vbs
exit
Last edited by zh159 on 2007-3-3 at 09:24 PM ]
|
|
2007-3-4 06:14 |
|
|
HUNRYBECKY
银牌会员
    
积分 1179
发帖 442
注册 2006-9-9
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
Originally posted by zh159 at 2007-3-4 06:14:
你这个还得需要两个html文件连接到
<frame name="left" src="html文件1">
<frame name="right" src="html文件2">
中才有效 ...
谢谢ZH兄的回答,目前我正学HTML编程,哪个程序我基本上搞定了,但还是有问题,上面提到的在同一页面上如何固定页首和页尾,使用FRAME方法需要另外两个叶面,很麻烦,那么有没有其他方法解决呢,难道FRAME真的就解决不了吗?直接在父FRAME对子FRAME引用编程能实现吗?如果不解决,真的很难看,下面是VBS代码,保存为VBS后大家测试下.
'引用shdocvw.dll的internetexplorer.application对象,如果fullscreen=1则没有标题栏
set WshShell = Wscript.CreateObject("Wscript.Shell")
set ie=wscript.createobject("internetexplorer.application","event_")
ie.fullscreen=1
ie.menubar=0
ie.addressbar=0
ie.toolbar=0
ie.statusbar=0
ie.resizable=0
ie.width=600
ie.height=400
ie.navigate "about:blank"
ie.left=fix((ie.document.parentwindow.screen.availwidth-ie.width)/2)
ie.top=fix((ie.document.parentwindow.screen.availheight-ie.height)/2)
ie.visible=1
with ie.document
.write "<html><title>一键安装管理器</title><meta http-equiv='Content-Type' content='text/html; charset=gbk'>"
.write "<style type='text/css' id='css'>.button {font: 15px 宋体, Verdana;height:32px;width:100px;}</style>"
.write "<body onload=sf() background='D:\OK\sys\FAX\bg.gif' bgcolor=#e3e5da oncontextmenu='return false' scroll=yes style='font-family:宋体;font-size:15px;'>"
.write "<table align=center style='font-family:楷体_gb2312;font-size:24px;'><td><b>一键安装管理器V1.0</b></td></table>"
.write "<table width=550 align=center style='FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde)'><td align=left style='font-size:1px;'> </td></table>"
.write "<table width=550 align=center borderColor=#698cc2 border=1 cellSpacing=0 cellpadding=5 style='font-size:15px;border:#5a7dde 3px solid;'>"
.write "<tr><td align=center bgcolor=#698cc2 style='FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde)' colspan=4><b><font style=font-size:18px;color:#ffffff;> 欢迎使用一键安装管理器 </font><br><font style=color:#d0d0d0;><a title='中国DOS联盟论坛'>QQ:9399100</a> <a title='参考zh159兄的IE批处理界面编写'>EMAIL:xiaobudian528@yahoo.com.cn</a></font></b></td></tr>"
.write "<tr><td align=left colspan=4><b>选择下列要安装的软件,然后点安装即可</td><tr>"
.write "<tr align=center><td colspan=1><b>软件名称</b></td><td colspan=3><b>软件说明</b></td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='32bit Fax x9.43.01 汉化版.exe'><b>32bit Fax x9.43.01 汉化版</b></td>"
.write "<td align=left colspan=3> </td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='FaxMail Network 94301.exe'><b>FaxMail Network 94301</b></td>"
.write "<td align=left colspan=3> </td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='HB-RelayFax504pro.rar'><b>HB-RelayFax504pro</b></td>"
.write "<td align=left colspan=3> ;下面的注释包含自释放脚本命令</td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='mf32_9X(mightyfax3.08).rar'><b>mf32_9X(mightyfax3.08)</b></td>"
.write "<td align=left colspan=3> </td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='mf32_NT(MightyFAX3.08).rar'><b>mf32_NT(MightyFAX3.08)</b></td>"
.write "<td align=left colspan=3> </td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='MightyFAX 3.08_9X_HYQ9.rar'><b>MightyFAX 3.08_9X_HYQ9</b></td>"
.write "<td align=left colspan=3> </td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='MightyFAX 3.08_NT_HYQ9.rar'><b>MightyFAX 3.08_NT_HYQ9</b></td>"
.write "<td align=left colspan=3> </td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='PC-Telephone V5.9(支持网络电话传真).exe'><b>PC-Telephone V5.9(支持网络电话传真)</b></td>"
.write "<td align=left colspan=3> </td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='test.rar'><b>test</b></td>"
.write "<td align=left colspan=3> width和height属性分别指定表格一个固定的宽度和长度,n1和n2可以用像素来表示,也可以用百分比(与整个屏幕相比的大小...rowsp</td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='VentaFax 5.7.26.exe'><b>VentaFax 5.7.26</b></td>"
.write "<td align=left colspan=3> </td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='WINFAXminiview.exe'><b>WINFAXminiview</b></td>"
.write "<td align=left colspan=3> </td><tr>"
.write "<tr><td align=left colspan=4 bgcolor=#698cc2 style='FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde);'><font style=font-size:15px;color:#ffffff;><b>安装模式:</b><input type='radio' CHECKED name='INSTALLMODLE' value='M1' title='默认为常规方式安装,不仅可以安装绿色软件,还可以安装普通软件,安装绿色软件时还可以不用预压缩'>一键常规安装<input type='radio' name='INSTALLMODLE' value='M2' title='只能安装预压缩的绿色软件,非绿色的软件将被忽略'>一键绿化安装<input type='radio' name='INSTALLMODLE' value='M3' title='对安装后的绿色软件进行修复,要求有绿色软件目录有GSETUP.bat存在'>一键绿化修复<input type='radio' name='INSTALLMODLE' value='M4' title='对安装后的绿色软件进行卸载,要求有绿色软件目录有install.bat存在'>一键绿化卸载<br><B>安装路径:</B><input type='text' ID='IPATH' name='IPATH' SIZE='70'value='D:\GREEN' title='设置时注意不要输入路径的最后一个\,如C:不要设置为C:\,又如C:\MYSOFT不要设置为C:\MYSOFT\,另外如果不设置则默认安装路径为D:\GREEN'></font></td></tr>"
.write "<tr><td align=center width=25% style='font-size:0px;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde);'> </td><td align=center width=25% style='font-size:0px;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde);'></td>"
.write "<td align=center width=25% style='font-size:0px;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde);'> </td><td align=center width=25% style='font-size:0px;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde);'> </td><tr></table>"
.write "<table width=550 align=center border=0 cellSpacing=0 cellpadding=5 ><tr align=center><td align=center width=25%><input id=btALL type=submit class=button value='全部选择' title='全部选择或取消全部选择以便进行软件安装' style='font-family:楷体_gb2312;font-size:21px;width=100;border: 1 solid #9ab8f6;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#10bfff,endColorStr=#007db2);cursor:hand;color:#ffffff;'></td><td align=center width=25%><input id=btInstall type=button class=button value='立即安装' title='立即安装选择的软件' style='font-family:楷体_gb2312;font-size:21px;width=100;border: 1 solid #9ab8f6;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#10bfff,endColorStr=#007db2);cursor:hand;color:#ffffff;'></td>"
.write "<td align=center width=25%><input id=btGInStallList type=button class=button value='制作安装脚本' title='在当前目录生成InStallList.TXT文件以便根据该文件进行安装,这样可以随意设置软件注释,提高安装速度.' style='font-family:楷体_gb2312;font-size:21px;width=140;border: 1 solid #9ab8f6;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#10bfff,endColorStr=#007db2);cursor:hand;color:#ffffff;'></td><td align=center width=25%><input type=button class=button onClick='opener=null;window.close()' value='退出程序' title='退出安装程序' style='font-family:楷体_gb2312;font-size:21px;width=100;border: 1 solid #9ab8f6;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#10bfff,endColorStr=#007db2);cursor:hand;color:#ffffff;'></td></tr></td></table>"
.write "</body></html>"
end with
dim wmi
set wnd=ie.document.parentwindow
set id=ie.document.all
id.btAll.onclick=getref("btALL")
id.btInstall.onclick=getref("btInstall")
id.btGInStallList.onclick=getref("btGInStallList")
do while true
wscript.sleep 500
WshShell.AppActivate ("一键安装管理器 - Microsoft Internet Explorer")
loop
sub event_onquit
Wscript.Echo "exit"
wscript.quit
end sub
sub btALL
with id
if .btALL.value="全部选择" then
for sx=0 to .InStallList.length-1
.InStallList(sx).checked=-1
next
.btALL.value="全部取消"
elseif .btALL.value="全部取消" then
for sx=0 to .InStallList.length-1
.InStallList(sx).checked=0
next
.btALL.value="全部选择"
end if
end with
end sub
sub btGInStallList
msg="制作安装脚本将会退出并重新启动该程序,确定吗?"
ie.visible=0
IF MsgBox(msg,vbQuestion+vbYesNo,"小布点提示您")=vbNo then
ie.visible=1
exit sub
END IF
Wscript.Echo "btGInStallList"
ie.quit
end sub
sub btInstall
ie.visible=0
with id
if .IPATH.value="" then
msgbox "安装路径不能为空,请重新输入!"
ie.visible=1
exit sub
elseif right(.IPATH.value,1)="\" then
msgbox "安装路径最后一个字符不能为\,请重新输入!"
ie.visible=1
exit sub
end if
Wscript.Echo .IPATH.value
dim mx
for mx=0 to 3
if .INSTALLMODLE(mx).checked=-1 then Wscript.Echo .INSTALLMODLE(mx).value
next
dim sx,nx
if isobject(InStallList)=fale then exit sub
nx=0
for sx=0 to .InStallList.length-1
if .InStallList(sx).checked=-1 then
nx=nx+1
Wscript.Echo .InStallList(sx).value
end if
next
ie.quit
end with
end sub
Last edited by HUNRYBECKY on 2007-3-7 at 01:08 AM ]
Originally posted by zh159 at 2007-3-4 06:14:
This still needs to be connected to two HTML files into
<frame name="left" src="html file 1">
<frame name="right" src="html file 2">
to be effective...
Thank you, Brother ZH for the answer. Currently, I am learning HTML programming. I have basically got the program done, but there is still a problem. The above-mentioned how to fix the header and footer on the same page. Using the FRAME method requires another two pages, which is very troublesome. So is there any other way to solve it? Does the FRAME really not solve it? Can it be realized by directly referencing the child FRAME in the parent FRAME for programming? If it is not solved, it is really ugly. The following is the VBS code, save it as VBS and everyone can test it.
'Reference the internetexplorer.application object of shdocvw.dll. If fullscreen=1, there is no title bar
set WshShell = Wscript.CreateObject("Wscript.Shell")
set ie=wscript.createobject("internetexplorer.application","event_")
ie.fullscreen=1
ie.menubar=0
ie.addressbar=0
ie.toolbar=0
ie.statusbar=0
ie.resizable=0
ie.width=600
ie.height=400
ie.navigate "about:blank"
ie.left=fix((ie.document.parentwindow.screen.availwidth-ie.width)/2)
ie.top=fix((ie.document.parentwindow.screen.availheight-ie.height)/2)
ie.visible=1
with ie.document
.write "<html><title>One-click Installation Manager</title><meta http-equiv='Content-Type' content='text/html; charset=gbk'>"
.write "<style type='text/css' id='css'>.button {font: 15px 宋体, Verdana;height:32px;width:100px;}</style>"
.write "<body onload=sf() background='D:\OK\sys\FAX\bg.gif' bgcolor=#e3e5da oncontextmenu='return false' scroll=yes style='font-family:宋体;font-size:15px;'>"
.write "<table align=center style='font-family:楷体_gb2312;font-size:24px;'><td><b>One-click Installation Manager V1.0</b></td></table>"
.write "<table width=550 align=center style='FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde)'><td align=left style='font-size:1px;'> </td></table>"
.write "<table width=550 align=center borderColor=#698cc2 border=1 cellSpacing=0 cellpadding=5 style='font-size:15px;border:#5a7dde 3px solid;'>"
.write "<tr><td align=center bgcolor=#698cc2 style='FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde)' colspan=4><b><font style=font-size:18px;color:#ffffff;> Welcome to use One-click Installation Manager </font><br><font style=color:#d0d0d0;><a title='China DOS Union Forum'>QQ:9399100</a> <a title='Refer to Brother zh159's IE batch processing interface writing'>EMAIL:xiaobudian528@yahoo.com.cn</a></font></b></td></tr>"
.write "<tr><td align=left colspan=4><b>Select the following software to install, then click Install to proceed</td><tr>"
.write "<tr align=center><td colspan=1><b>Software Name</b></td><td colspan=3><b>Software Description</b></td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='32bit Fax x9.43.01 汉化版.exe'><b>32bit Fax x9.43.01 Chinese Version</b></td>"
.write "<td align=left colspan=3> </td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='FaxMail Network 94301.exe'><b>FaxMail Network 94301</b></td>"
.write "<td align=left colspan=3> </td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='HB-RelayFax504pro.rar'><b>HB-RelayFax504pro</b></td>"
.write "<td align=left colspan=3> ;The following comments contain self-extracting script commands</td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='mf32_9X(mightyfax3.08).rar'><b>mf32_9X(mightyfax3.08)</b></td>"
.write "<td align=left colspan=3> </td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='mf32_NT(MightyFAX3.08).rar'><b>mf32_NT(MightyFAX3.08)</b></td>"
.write "<td align=left colspan=3> </td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='MightyFAX 3.08_9X_HYQ9.rar'><b>MightyFAX 3.08_9X_HYQ9</b></td>"
.write "<td align=left colspan=3> </td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='MightyFAX 3.08_NT_HYQ9.rar'><b>MightyFAX 3.08_NT_HYQ9</b></td>"
.write "<td align=left colspan=3> </td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='PC-Telephone V5.9(支持网络电话传真).exe'><b>PC-Telephone V5.9(Supports Network Telephone Fax)</b></td>"
.write "<td align=left colspan=3> </td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='test.rar'><b>test</b></td>"
.write "<td align=left colspan=3> width and height attributes respectively specify a fixed width and length of the table, n1 and n2 can be expressed in pixels or as a percentage (compared with the size of the entire screen...rowsp</td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='VentaFax 5.7.26.exe'><b>VentaFax 5.7.26</b></td>"
.write "<td align=left colspan=3> </td><tr>"
.write "<tr><td align=left colspan=1><INPUT type='checkbox' CHECKED name='InStallList' value='WINFAXminiview.exe'><b>WINFAXminiview</b></td>"
.write "<td align=left colspan=3> </td><tr>"
.write "<tr><td align=left colspan=4 bgcolor=#698cc2 style='FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde);'><font style=font-size:15px;color:#ffffff;><b>Installation Mode:</b><input type='radio' CHECKED name='INSTALLMODLE' value='M1' title='The default is to install in the conventional way, which can not only install green software, but also install ordinary software. When installing green software, it can also be installed without pre-compression'>One-click Conventional Installation<input type='radio' name='INSTALLMODLE' value='M2' title='Can only install pre-compressed green software, non-green software will be ignored'>One-click Green Installation<input type='radio' name='INSTALLMODLE' value='M3' title='Repair the installed green software, requiring that there is GSETUP.bat in the green software directory'>One-click Green Repair<input type='radio' name='INSTALLMODLE' value='M4' title='Uninstall the installed green software, requiring that there is install.bat in the green software directory'>One-click Green Uninstall<br><B>Installation Path:</B><input type='text' ID='IPATH' name='IPATH' SIZE='70'value='D:\GREEN' title='When setting, pay attention not to enter the last \ of the path, for example, C: should not be set to C:\, for example, C:\MYSOFT should not be set to C:\MYSOFT\, in addition, if not set, the default installation path is D:\GREEN'></font></td></tr>"
.write "<tr><td align=center width=25% style='font-size:0px;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde);'> </td><td align=center width=25% style='font-size:0px;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde);'></td>"
.write "<td align=center width=25% style='font-size:0px;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde);'> </td><td align=center width=25% style='font-size:0px;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#9ab8f6,endColorStr=#5a7dde);'> </td><tr></table>"
.write "<table width=550 align=center border=0 cellSpacing=0 cellpadding=5 ><tr align=center><td align=center width=25%><input id=btALL type=submit class=button value='Select All' title='Select All or Cancel All to facilitate software installation' style='font-family:楷体_gb2312;font-size:21px;width=100;border: 1 solid #9ab8f6;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#10bfff,endColorStr=#007db2);cursor:hand;color:#ffffff;'></td><td align=center width=25%><input id=btInstall type=button class=button value='Install Now' title='Install the selected software now' style='font-family:楷体_gb2312;font-size:21px;width=100;border: 1 solid #9ab8f6;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#10bfff,endColorStr=#007db2);cursor:hand;color:#ffffff;'></td>"
.write "<td align=center width=25%><input id=btGInStallList type=button class=button value='Make Installation Script' title='Generate InStallList.TXT file in the current directory to facilitate installation according to this file, so that software comments can be set arbitrarily and installation speed can be improved.' style='font-family:楷体_gb2312;font-size:21px;width=140;border: 1 solid #9ab8f6;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#10bfff,endColorStr=#007db2);cursor:hand;color:#ffffff;'></td><td align=center width=25%><input type=button class=button onClick='opener=null;window.close()' value='Exit Program' title='Exit Installation Program' style='font-family:楷体_gb2312;font-size:21px;width=100;border: 1 solid #9ab8f6;FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#10bfff,endColorStr=#007db2);cursor:hand;color:#ffffff;'></td></tr></td></table>"
.write "</body></html>"
end with
dim wmi
set wnd=ie.document.parentwindow
set id=ie.document.all
id.btAll.onclick=getref("btALL")
id.btInstall.onclick=getref("btInstall")
id.btGInStallList.onclick=getref("btGInStallList")
do while true
wscript.sleep 500
WshShell.AppActivate ("One-click Installation Manager - Microsoft Internet Explorer")
loop
sub event_onquit
Wscript.Echo "exit"
wscript.quit
end sub
sub btALL
with id
if .btALL.value="Select All" then
for sx=0 to .InStallList.length-1
.InStallList(sx).checked=-1
next
.btALL.value="Cancel All"
elseif .btALL.value="Cancel All" then
for sx=0 to .InStallList.length-1
.InStallList(sx).checked=0
next
.btALL.value="Select All"
end if
end with
end sub
sub btGInStallList
msg="Making the installation script will exit and restart this program, are you sure?"
ie.visible=0
IF MsgBox(msg,vbQuestion+vbYesNo,"Xiao Budian Reminds You")=vbNo then
ie.visible=1
exit sub
END IF
Wscript.Echo "btGInStallList"
ie.quit
end sub
sub btInstall
ie.visible=0
with id
if .IPATH.value="" then
msgbox "Installation path cannot be empty, please re-enter!"
ie.visible=1
exit sub
elseif right(.IPATH.value,1)="\" then
msgbox "The last character of the installation path cannot be \, please re-enter!"
ie.visible=1
exit sub
end if
Wscript.Echo .IPATH.value
dim mx
for mx=0 to 3
if .INSTALLMODLE(mx).checked=-1 then Wscript.Echo .INSTALLMODLE(mx).value
next
dim sx,nx
if isobject(InStallList)=fale then exit sub
nx=0
for sx=0 to .InStallList.length-1
if .InStallList(sx).checked=-1 then
nx=nx+1
Wscript.Echo .InStallList(sx).value
end if
next
ie.quit
end with
end sub
Last edited by HUNRYBECKY on 2007-3-7 at 01:08 AM ]
|
|
2007-3-7 00:09 |
|
|