is it possible to write in a file using vbscript with ppc 2003???

Take a script, leave a script - Like the penny tray only different

is it possible to write in a file using vbscript with ppc 2003???

Postby Pioupioumax » Fri Jul 23, 2004 1:15 am

Someone is able to write in a file under ppc 2003 using vbscript??????
when I type :

"Dim oFS,oTS
Set oFS = CreateObject("Scripting.FileSystemObject")
Set oTS = oFS.OpenTextFile("\test.txt", 2, True)"

I got an activeX error : "Activex component can't create object"
Any Idea to solve that????
thanks
Pioupioumax
Mini Stumbler
 
Posts: 4
Joined: Wed Jun 02, 2004 2:25 am

Postby Thorn » Fri Jul 23, 2004 5:32 am

It would appear from that error message that the Active X DLLs aren't loaded. I've not done any scripting on a PPC, so take this with a grain of salt. My suggestion is to search the MS Knowledge Base.

By the way, crossposting is against the Rules. The other post with this same question has been removed.
Thorn
Stop the TSA now! Boycott the airlines.
Thorn
 
Posts: 10340
Joined: Sat Apr 13, 2002 3:00 am
Location: Villa Straylight

Postby kapser » Wed Aug 11, 2004 8:07 am

I've the same ActiveX problem with CreateObject.

PiouPiouMax, did you solved your problem ?
kapser
Mini Stumbler
 
Posts: 1
Joined: Wed Aug 11, 2004 5:21 am

Postby Pioupioumax » Wed Aug 25, 2004 8:37 am

Ok after long search I can do that using another thing:
you simply need to do that .
The source is a little special because I want to access the file alone, locking the other programs to do that.
Only the WriteSetting or ReadSetting function is usefull.
I learn that in a foreign site (anybody now the country?) that you can find at:
http://www.eitcenter.com/pocketpc/develop/gamewrite18.htm

Sorry for the comments but I m French, If you need more informations just ask.

Const fsModeInput = 1
Const fsModeOutput = 2
Const fsModeRandom = 4
Const fsModeAppend = 8
Const fsModeBinary = 32
Const fsAccessRead = 1
Const fsAccessWrite = 2
Const fsAccessReadWrite = 3
Const fsLockReadWrite = 0
Const fsLockWrite = 1
Const fsLockRead = 2
Const fsLockShared = 3
Const monFichier = "\vbsTest.txt"

Dim cpt,tmp,tmp2
cpt = 1
tmp = 0
tmp2 = 0

Do While cpt < 10000000000000000000000
tmp = Second(FormatDateTime(now,3))
WriteSetting "Ap1", -53,100, fsModeOutput 'créer un nouveau fichier vide
WriteSetting "Ap2",42,100,fsModeAppend
WriteSetting "Ap3", 45, 100,fsModeAppend
do while tmp = tmp2
tmp = Second(FormatDateTime(now,3))
loop
tmp2 = tmp
'JoueSon
loop
'msgbox ReadSetting("ap2")

Public Sub WriteSetting(ByVal ssid, ByVal signal,ByVal noise, iMode)
Dim filWrite,numerr,abouterr
On Error Resume Next
'on regarde si le fichier peut etre lu
Set filWrite=CreateObject("FileCtl.File")
numerr = 1
Do While numerr <> 0
Err.number = 0
filWrite.open monFichier, iMode, fsAccessWrite, fsLockReadWrite
numerr = Err.number
abouterr = Err.source
loop
filWrite.LinePrint FormatDateTime(now,3) & "$" & ssid & "$" & signal & "$" & cpt
cpt = cpt + 13
filWrite.close
Set filWrite=Nothing
'JoueSon
End Sub

Public Function ReadSetting(ByVal ssid)
Dim filRead
Set filRead=CreateObject("FileCtl.File")
filRead.open monFichier, fsModeInput
do while not filRead.EOF
sLine=filRead.LineInputString
Myarray = split(sLine,"$",-1,1)
if LCase(myarray(1))=LCase(ssid) then
ReadSetting=myarray(2)
end if
loop
filRead.close
Set filRead=Nothing
End Function

Public Sub JoueSon
PlaySound "\windows\alarm3"
End Sub


Sub OnScanResult(SSID, BSSID, CapFlags, Signal, Noise, LastSeen)
' MsgBox "OnScanResult " & SSID & " " & BSSID & " " & CapFlags & " " & Signal & " " & Noise & " " & LastSeen
if cpt = 3 then
WriteSetting SSID,Signal,Noise,fsModeOutput
else
WriteSetting SSID,Signal,Noise,fsModeAppend
End if
end sub
Pioupioumax
Mini Stumbler
 
Posts: 4
Joined: Wed Jun 02, 2004 2:25 am


Return to Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

cron