找回密码
 加入
搜索
查看: 3579|回复: 5

[系统综合] 谁能帮我把这段批处理改成au3的,非常感谢呀。(已解决)

[复制链接]
发表于 2010-3-24 10:33:40 | 显示全部楼层 |阅读模式
本帖最后由 devineresse 于 2010-3-25 15:09 编辑

@echo off

REM PostgreSQL server psql runner script for Windows
REM Dave Page, EnterpriseDB

SET server=localhost
SET /P server="Server [%server%]: "

SET database=postgres
SET /P database="Database [%database%]: "

SET port=5432
SET /P port="Port [%port%]: "

SET username=postgres
SET /P username="Username [%username%]: "

for /f "delims=" %%a in ('chcp ^|find /c "932"') do @ SET CLIENTENCODING_JP=%%a
if "%CLIENTENCODING_JP%"=="1" SET PGCLIENTENCODING=SJIS
if "%CLIENTENCODING_JP%"=="1" SET /P PGCLIENTENCODING="Client Encoding [%PGCLIENTENCODING%]: "

REM Run psql
"C:\Program Files\PostgreSQL\8.4\bin\psql.exe" -h %server% -U %username% -d %database% -p %port%

pause

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

 楼主| 发表于 2010-3-24 10:36:01 | 显示全部楼层
以上是数据库连接用的,我无法用au3直接连接postgres数据库,但是这个数据库自带的批处理可以,我想给它改成au3的。

另外如果能通过想问一下,如何通过au3连接postgresql并且进行查询。
发表于 2010-3-24 16:11:55 | 显示全部楼层
最关键一句

C:\Program Files\PostgreSQL\8.4\bin\psql.exe" -h %server% -U %username% -d %database% -p %port%
发表于 2010-3-24 17:24:58 | 显示全部楼层
Global $server=InputBox("Server", "type your server address", "localhost", "",200, 100)
Global $database =InputBox("database", "type your database name", "postgres", "",200, 100)
Global $port=InputBox("port", "type your sql port", "5432", "",200, 100)
Global $username=InputBox("user", "type your username", "123", "",200, 100)
Run("C:\Program Files\PostgreSQL\8.4\bin\psql.exe"&" -h "&$server&" -u "&$username&" -d "&$database&" -p "&$port)

评分

参与人数 1金钱 +20 收起 理由
afan + 20

查看全部评分

发表于 2010-3-24 20:47:50 | 显示全部楼层
谢谢分享!!
 楼主| 发表于 2010-3-25 15:08:58 | 显示全部楼层
回复 4# l4ever


     谢谢啊14ever,这么一看就明白是什么意思了。太感谢了,我马上试试。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-10 22:26 , Processed in 0.090275 second(s), 28 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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