Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Thu Apr 02, 2020 9:33 am

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
PostPosted: Fri May 31, 2013 3:41 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
If we have Unicode in the XML data then create_file = "y" will fail when writing the data:
Code:
Creating output File
Output file: computer.txt
Problem writing to file.
Error Number:5
Error Description:Invalid procedure call or argument


We need to open the text file as Unicode.

Code:
--- audit_windows.dist   Mon May 20 13:35:48 2013
+++ audit_windows.vbs   Thu May 30 10:27:20 2013
@@ -175,0 +176 @@
+Const TristateTrue          = -1
@@ -470 +471 @@
-               set objTS = objFSO.OpenTextFile(OutputFile, FOR_APPENDING, True)
+               set objTS = objFSO.OpenTextFile(OutputFile, FOR_APPENDING, True, TristateTrue)
@@ -6034 +6035 @@
-   set objTS = objFSO.OpenTextFile(OutputFile, FOR_APPENDING, True)
+   set objTS = objFSO.OpenTextFile(OutputFile, FOR_APPENDING, True, TristateTrue)


Top
 Profile  
Reply with quote  
PostPosted: Fri May 31, 2013 8:08 am 
Offline
Site Admin
User avatar

Joined: Mon Jun 07, 2004 11:48 am
Posts: 1964
Location: Brisbane, Australia
Have patched my version - thanks.

_________________
Support and Development hours available from Opmantek.
Please consider a purchase to help make Open-AudIT better for everyone.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 13, 2013 3:37 am 
Offline
Moderator

Joined: Fri Jul 20, 2007 8:27 am
Posts: 1259
While the proposed fix by franam and myself works I don't think it's ideal. Our fix outputs a UCS-2 file not UTF-8 and is larger than a UTF-8 file as well.

Attached is some edits on audit_windows.vbs that removes OpenTextFile and uses the ADODB.Stream SaveToFile to write a proper UTF-8 encoded file which is also half the size of the previous method and should use less ram while writing.


Attachments:
audit_windows_1.0.2_jpa.txt [326.33 KiB]
Downloaded 200 times
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group