找回密码
 加入
搜索
查看: 1804|回复: 6

新建文本的问题

[复制链接]
发表于 2008-10-4 13:54:03 | 显示全部楼层 |阅读模式
Run("notepad.exe")
WinWaitActive("无标题 - 记事本")
Send("@echo off")
send("{enter}")
Send("title Please input password:")
send("{enter}")
Send(":start")
send("{enter}")
Send("set /p pwd=Please Input Password:")
Send("{enter}")
Send("if "%pwd%"=="system32" goto ok else goto end")
send("{enter}")
Send(":end")
send("{enter}")
Send("echo Error Password,press anykey exit")
send("{enter}")
Send("pause")
send("{enter}")
Send("exit")
send("{enter}")
Send(":ok")
send("{enter}")
Send("title Welcome to back")
WinClose("无标题 - 记事本")


Send("if "%pwd%"=="system32" goto ok else goto end") 到这一行提示错误
请问改怎么写?

[ 本帖最后由 鱼儿 于 2008-10-4 16:34 编辑 ]
发表于 2008-10-4 14:26:31 | 显示全部楼层
Send('if "%pwd%" == "system32" goto ok else goto end')
autoit貌似不能转义..那就把两头的"换成'...
 楼主| 发表于 2008-10-4 14:55:17 | 显示全部楼层
原帖由 rolaka 于 2008-10-4 14:26 发表
Send('if "%pwd%" == "system32" goto ok else goto end')
autoit貌似不能转义..那就把两头的"换成'...

我是要让他输入括号里面的字
发表于 2008-10-4 15:02:26 | 显示全部楼层
原话是什么样的,主要是有几个引号,和位置

[ 本帖最后由 netegg 于 2008-10-4 15:03 编辑 ]
发表于 2008-10-4 16:43:45 | 显示全部楼层

Run("notepad.exe") 
WinWaitActive("无标题 - 记事本")
Send('@echo off{enter}title Please input password:{enter}:start{enter}set /p pwd=Please Input Password:{enter}if "%pwd%"=="system32" goto ok else goto end{enter}:end{enter}echo Error Password,press anykey exit{enter}pause{enter}exit{enter}:ok{enter}title Welcome to back')
WinClose("无标题 - 记事本")
发表于 2008-10-4 16:45:37 | 显示全部楼层
不知道楼主这样做是什么回事,只按你的原样稍修饰了一下!
如果是要写一个文件的,可以用:FileWrite() 或 FileWriteLine()

如果只是用于显示一下的,可以用:WinKill 或 ProcessClose() ,以免出现文件保存对话框

[ 本帖最后由 liongodmien 于 2008-10-4 16:47 编辑 ]
发表于 2008-10-4 18:48:15 | 显示全部楼层
原帖由 鱼儿 于 2008-10-4 14:55 发表

我是要让他输入括号里面的字

= = 就是啊.因为autoit把需要输入的部分中的"看做了临界...用'换掉就可以了啊
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-4 19:10 , Processed in 0.069166 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表