Scripthost =Wscript.fullnamescripthost= Right (Scripthost, One)if not(UCase (scripthost) = "CSCRIPT. EXE ") ThenSetWs=Create ("Wscript.Shell") Ws.run "cscript/nologo "& " "" "&wscript.scriptfullname&" "" Wscript.QuitEnd ifSetargs =wscript.argumentsifArgs.count<>3 Then Call HelpEnd ifSetconn =CreateObject ("ADODB. Connection ") pwd= "Dense" &CHR ( -) &CHR (9) &CHR (Ten) & "Code" &CHR (2) ConnStr= "Provider=microsoft.jet.oledb."4.0; Data source= "& Args (1) & "; Mode=share Deny read| Share Deny Write; Persist Security Info=false; Jet Oledb:database password="&pwd&"; Conn.Open ConnStrSetfso=CreateObject ("Scripting.FileSystemObject")if(Args (0) = "/I") ThenCall ImportElseCall ExportEnd ifConn.closeSetfso= NothingSetconn=Nothingwscript.echo "Done"functionHelp () WScript.Echo "Chopper Export/Import Tool by ZCGONVH "WScript.Echo" Usage:cscript "&wscript.scriptname& "</e|/i>MDB TXT "WScript.Echo"/e:export totext "WScript.Echo"/i:import from text "Wscript.QuitEnd functionfunctionExport ()SetOptfile=fso.opentextfile (Args (2),8, True)Setrs =CreateObject ("ADODB. RecordSet ") Rs. Open "Select* FROM SITE ", Conn,1,1 Do while notRs.eoftmptext=rs ("SiteURL") &CHR (9) & RS ("Sitepass") &CHR (9) & RS ("Ntype") &CHR (9) & RS ("Ncodepage") &CHR (9) Select Casers ("Nscript") Case 0: tmptext=tmptext& "PHP" Case 1: tmptext=tmptext& "aspx" Case 2: tmptext=tmptext& "ASP" Case Else: tmptext=tmptext& "Customize"EndSelectoptfile.writeline Tmptextrs.movenextlooprs.closeoptfile.closeSetoptfile= NothingSetrs= NothingEnd functionfunctionimport () Set optfile=fso.opentextfile (Args (2),1) Do while notOptfile.atendofstreamtmparr= Split (OPTFILE.READLINE,CHR (9)) SQL= "INSERT INTO SITE" (Siteurl,sitepass,ntype,ncodepage,nscript) VALUES ("" "&tmparr (0) & "", "" "&tmparr (1) & "", "&tmparr (2) & "," &tmparr (3) & "," Select CaseLCase (Tmparr (4)) Case"PHP":sql=sql& "0)" Case"aspx":sql=sql& "1)" Case"ASP":sql=sql& "2)" Case Else:sql=sql& "3)"Endselectconn.execute (sql) LoopSetOptfile = NothingEnd function
Usage:
/i db.mdb export.txt
Passwords in various languages:
"Secret" &CHR (&chr) (9) &CHR (ten) & "code" &CHR (2) byte pwd[] ={0xc3,0xdc,0x0d,0x09,0x0a,0xc2,0xeb,0x02};(char*) pwdencoding.getencoding ( 936). GetString (new byte[]{0xc3,0xdc,0x0d,0x09,0x0a,0xc2,0xeb,0x02})
The 64-bit system needs to use the following command
%WINDIR%\SYSWOW64\CMD.EXE/C cscript exp.vbs/e Db.mdb export.txt
Chinese kitchen knife Batch export data