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 Fri Mar 29, 2024 1:59 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[/code]

We need to [url=http://msdn.microsoft.com/en-us/library/314cz14s%28v=vs.84%29.aspx]open the text file as Unicode[/url].

[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)[/code]


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 [url=https://opmantek.com]Opmantek[/url].
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 [url=http://www.open-audit.org/phpBB3/viewtopic.php?f=20&t=5864&start=45#p21844]franam[/url] 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 347 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