Jump to content

eben80

Members
  • Posts

    8
  • Joined

  • Last visited

eben80's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Hi all, I have looked though all the search results on the text search topic but couldn't find anything that do what I need it to do. part of my script creates a dump file of the cipher command on a particular folder. I need the script to then look for the occurrence of " U " anywhere in the text file but I'm having problems loading the whole text file into a variable... I only get the first line when I try to display it. The text file is called efs_dump.log: Listing C:\Documents and Settings\My Documents\ New files added to this directory will not be encrypted. U 10Feb.csv U 18FebDR.csv U 22FebDR.csv U 23FebDR.csv U 24FebDR.csv U 2K7.csv U BO_Diff.xls U EFS-Report.xls U EFS-Report_Template.xls U EFS-Report_V2.xls U EFS-Report_V3.xls U IE7_Cardiff.csv U IE7_Exclusions.csv U Log Viewer U maps.txt U My Music U My Pictures U My Videos U My Virtual Machines U PM_Reports U Power Managment Summary 06032010.xls U PowerManagemen.xls U SAP_Patch_14_UVT.csv U SAP_Test_Devices.csv U SAP_UPgrade15032010.csv U SWDReport_template.v4.0.xls Listing C:\Documents and Settings\3rdellewsdfgdsgee\My Documents\Log Viewer\ New files added to this directory will not be encrypted. U Altiris.Diagnostics.dll U LogViewer.exe U SourceGrid2.dll U SourceLibrary.dll Listing C:\Documents and Settings\3rdesfdasfllewee\My Documents\My Data Sources\ New files added to this directory will not be encrypted. U +Connect to New Data Source.odc U +New SQL Server Connection.odc U DATACONN.HTC Listing C:\Documents and Settings\3rdellewee\My Documents\My Music\ New files added to this directory will not be encrypted. U Sample Music.lnk Listing C:\Documents and Settings\3rdellewee\My Documents\My Pictures\ New files added to this directory will not be encrypted. U Sample Pictures.lnk U tssdfysdfassftems.ico Listing C:\Documents and Settings\3rdelsfasflewee\My Documents\My Videos\ New files added to this directory will not be encrypted. Listing C:\Documents and Settings\3sadfsfrdellewee\My Documents\My Virtual Machines\ New files added to this directory will not be encrypted. Listing C:\Documents and Settings\3rdellsfsfdwee\My Documents\PM_Reports\ New files added to this directory will not be encrypted. U 16032010.xls U 17032010.xls U 18032010.xls How do I get the script to set a boolean if ANY " U " is found in the whole text file? I've tried FileRead, FileReadLine with loops etc etc. but I don't get the full text of the file. This is one of my attempts: $ourProcess22 = Run(@ComSpec & " /c" & "cipher.exe /S:""C:\Documents and Settings\" & @UserName & "\My Documents"" > C:\Support\Logs\efs_dump.log", "", @SW_HIDE, 2) $dumpfile = "C:\support\logs\efs_dump.log" $dumpstring = FileRead($dumpfile) MsgBox(0, "String", $dumpstring) $recurse_encrypted = StringInStr($dumpstring, " U ") MsgBox(0, "Found", $recurse_encrypted) Please help
  2. Hi all, I have searched high and low on the forum but I have not been able to fix the problem I have with reading a value from an xml file. I think it is because I don't know how the whole namespace setup works. The xml file: <?xml version="1.0" standalone="yes"?> <AppConfig xmlns="http://tempuri.org/AppConfig.xsd"> <AppDetails> <AppName>W:\Projects\Avaya-Softconsole_5.05.5_B2.0\Avaya-Softconsole_5.05.5_B2.0</AppName> <MSIName>&lt;msi_name&gt;</MSIName> <AppGroup>d-APP-AVAYA-SOFTCONSOLE</AppGroup> </AppDetails> <ACLSettings> <ObjectId>1</ObjectId> <ObjectType>Registry Keys</ObjectType> <ObjectPath>CLASSES_ROOT\Interface\{6BDF9F08-BCA8-11D1-A46D-444553540000}</ObjectPath> <PropagateACL>0</PropagateACL> <DescriptorControlFlags> <ObjectId>1</ObjectId> <Protected>true</Protected> <AutoInheritReqd>true</AutoInheritReqd> <AutoInherited>false</AutoInherited> </DescriptorControlFlags> <ACEEntry> <ObjectId>1</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>BA</Trustee> </ACEEntry> <ACEEntry> <ObjectId>1</ObjectId> <Type>A</Type> <Flag>CIIO</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>CO</Trustee> </ACEEntry> <ACEEntry> <ObjectId>1</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>CCDCLCSWRPRC</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>d-APP-AVAYA-SOFTCONSOLE</Trustee> </ACEEntry> <ACEEntry> <ObjectId>1</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>SY</Trustee> </ACEEntry> <ACEEntry> <ObjectId>1</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KR</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>BU</Trustee> </ACEEntry> </ACLSettings> <ACLSettings> <ObjectId>2</ObjectId> <ObjectType>Registry Keys</ObjectType> <ObjectPath>CLASSES_ROOT\Interface\{6BDF9F07-BCA8-11D1-A46D-444553540000}</ObjectPath> <PropagateACL>0</PropagateACL> <DescriptorControlFlags> <ObjectId>2</ObjectId> <Protected>true</Protected> <AutoInheritReqd>true</AutoInheritReqd> <AutoInherited>false</AutoInherited> </DescriptorControlFlags> <ACEEntry> <ObjectId>2</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>BA</Trustee> </ACEEntry> <ACEEntry> <ObjectId>2</ObjectId> <Type>A</Type> <Flag>CIIO</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>CO</Trustee> </ACEEntry> <ACEEntry> <ObjectId>2</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>CCDCLCSWRPRC</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>d-APP-AVAYA-SOFTCONSOLE</Trustee> </ACEEntry> <ACEEntry> <ObjectId>2</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>SY</Trustee> </ACEEntry> <ACEEntry> <ObjectId>2</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KR</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>BU</Trustee> </ACEEntry> </ACLSettings> <ACLSettings> <ObjectId>3</ObjectId> <ObjectType>Registry Keys</ObjectType> <ObjectPath>CLASSES_ROOT\PhlineX.PhoneLineXCtrl.1</ObjectPath> <PropagateACL>0</PropagateACL> <DescriptorControlFlags> <ObjectId>3</ObjectId> <Protected>true</Protected> <AutoInheritReqd>true</AutoInheritReqd> <AutoInherited>false</AutoInherited> </DescriptorControlFlags> <ACEEntry> <ObjectId>3</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>BA</Trustee> </ACEEntry> <ACEEntry> <ObjectId>3</ObjectId> <Type>A</Type> <Flag>CIIO</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>CO</Trustee> </ACEEntry> <ACEEntry> <ObjectId>3</ObjectId> <Type>A</Type> <Flag /> <Permission>CCDCLC</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>d-APP-AVAYA-SOFTCONSOLE</Trustee> </ACEEntry> <ACEEntry> <ObjectId>3</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KR</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>d-APP-AVAYA-SOFTCONSOLE</Trustee> </ACEEntry> <ACEEntry> <ObjectId>3</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>SY</Trustee> </ACEEntry> <ACEEntry> <ObjectId>3</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KR</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>BU</Trustee> </ACEEntry> </ACLSettings> <ACLSettings> <ObjectId>4</ObjectId> <ObjectType>Registry Keys</ObjectType> <ObjectPath>CLASSES_ROOT\TypeLib</ObjectPath> <PropagateACL>0</PropagateACL> <DescriptorControlFlags> <ObjectId>4</ObjectId> <Protected>true</Protected> <AutoInheritReqd>true</AutoInheritReqd> <AutoInherited>false</AutoInherited> </DescriptorControlFlags> <ACEEntry> <ObjectId>4</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>BA</Trustee> </ACEEntry> <ACEEntry> <ObjectId>4</ObjectId> <Type>A</Type> <Flag>CIIO</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>CO</Trustee> </ACEEntry> <ACEEntry> <ObjectId>4</ObjectId> <Type>A</Type> <Flag /> <Permission>CCDCLC</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>d-APP-AVAYA-SOFTCONSOLE</Trustee> </ACEEntry> <ACEEntry> <ObjectId>4</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KR</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>d-APP-AVAYA-SOFTCONSOLE</Trustee> </ACEEntry> <ACEEntry> <ObjectId>4</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>SY</Trustee> </ACEEntry> <ACEEntry> <ObjectId>4</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KR</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>BU</Trustee> </ACEEntry> </ACLSettings> <ACLSettings> <ObjectId>5</ObjectId> <ObjectType>Registry Keys</ObjectType> <ObjectPath>CLASSES_ROOT\CLSID\{6BDF9F09-BCA8-11D1-A46D-444553540000}</ObjectPath> <PropagateACL>0</PropagateACL> <DescriptorControlFlags> <ObjectId>5</ObjectId> <Protected>true</Protected> <AutoInheritReqd>true</AutoInheritReqd> <AutoInherited>false</AutoInherited> </DescriptorControlFlags> <ACEEntry> <ObjectId>5</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>BA</Trustee> </ACEEntry> <ACEEntry> <ObjectId>5</ObjectId> <Type>A</Type> <Flag>CIIO</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>CO</Trustee> </ACEEntry> <ACEEntry> <ObjectId>5</ObjectId> <Type>A</Type> <Flag /> <Permission>CCDCLC</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>d-APP-AVAYA-SOFTCONSOLE</Trustee> </ACEEntry> <ACEEntry> <ObjectId>5</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KR</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>d-APP-AVAYA-SOFTCONSOLE</Trustee> </ACEEntry> <ACEEntry> <ObjectId>5</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>SY</Trustee> </ACEEntry> <ACEEntry> <ObjectId>5</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KR</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>BU</Trustee> </ACEEntry> </ACLSettings> <ACLSettings> <ObjectId>6</ObjectId> <ObjectType>Registry Keys</ObjectType> <ObjectPath>CLASSES_ROOT\CLSID\{6BDF9F0A-BCA8-11D1-A46D-444553540000}</ObjectPath> <PropagateACL>0</PropagateACL> <DescriptorControlFlags> <ObjectId>6</ObjectId> <Protected>true</Protected> <AutoInheritReqd>true</AutoInheritReqd> <AutoInherited>false</AutoInherited> </DescriptorControlFlags> <ACEEntry> <ObjectId>6</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>BA</Trustee> </ACEEntry> <ACEEntry> <ObjectId>6</ObjectId> <Type>A</Type> <Flag>CIIO</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>CO</Trustee> </ACEEntry> <ACEEntry> <ObjectId>6</ObjectId> <Type>A</Type> <Flag /> <Permission>CCDCLC</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>d-APP-AVAYA-SOFTCONSOLE</Trustee> </ACEEntry> <ACEEntry> <ObjectId>6</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KR</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>d-APP-AVAYA-SOFTCONSOLE</Trustee> </ACEEntry> <ACEEntry> <ObjectId>6</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>SY</Trustee> </ACEEntry> <ACEEntry> <ObjectId>6</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KR</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>BU</Trustee> </ACEEntry> </ACLSettings> <ACLSettings> <ObjectId>7</ObjectId> <ObjectType>Registry Keys</ObjectType> <ObjectPath>MACHINE\SOFTWARE\Avaya</ObjectPath> <PropagateACL>0</PropagateACL> <DescriptorControlFlags> <ObjectId>7</ObjectId> <Protected>true</Protected> <AutoInheritReqd>true</AutoInheritReqd> <AutoInherited>false</AutoInherited> </DescriptorControlFlags> <ACEEntry> <ObjectId>7</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>BA</Trustee> </ACEEntry> <ACEEntry> <ObjectId>7</ObjectId> <Type>A</Type> <Flag>CIIO</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>CO</Trustee> </ACEEntry> <ACEEntry> <ObjectId>7</ObjectId> <Type>A</Type> <Flag /> <Permission>CCDCLC</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>d-APP-AVAYA-SOFTCONSOLE</Trustee> </ACEEntry> <ACEEntry> <ObjectId>7</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KR</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>d-APP-AVAYA-SOFTCONSOLE</Trustee> </ACEEntry> <ACEEntry> <ObjectId>7</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>SY</Trustee> </ACEEntry> <ACEEntry> <ObjectId>7</ObjectId> <Type>A</Type> <Flag>CI</Flag> <Permission>KR</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>BU</Trustee> </ACEEntry> </ACLSettings> <ACLSettings> <ObjectId>8</ObjectId> <ObjectType>File Security</ObjectType> <ObjectPath>%ProgramFiles%\Avaya\Avaya Softconsole</ObjectPath> <PropagateACL>0</PropagateACL> <DescriptorControlFlags> <ObjectId>8</ObjectId> <Protected>true</Protected> <AutoInheritReqd>true</AutoInheritReqd> <AutoInherited>false</AutoInherited> </DescriptorControlFlags> <ACEEntry> <ObjectId>8</ObjectId> <Type>A</Type> <Flag>OICI</Flag> <Permission>FA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>BA</Trustee> </ACEEntry> <ACEEntry> <ObjectId>8</ObjectId> <Type>A</Type> <Flag>OICIIO</Flag> <Permission>FA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>CO</Trustee> </ACEEntry> <ACEEntry> <ObjectId>8</ObjectId> <Type>A</Type> <Flag>OICI</Flag> <Permission>0x1201bf</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>d-APP-AVAYA-SOFTCONSOLE</Trustee> </ACEEntry> <ACEEntry> <ObjectId>8</ObjectId> <Type>A</Type> <Flag>OICI</Flag> <Permission>FA</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>SY</Trustee> </ACEEntry> <ACEEntry> <ObjectId>8</ObjectId> <Type>A</Type> <Flag>OICI</Flag> <Permission>0x1200a9</Permission> <ObjectType /> <InheritedObjectType /> <Trustee>BU</Trustee> </ACEEntry> </ACLSettings> </AppConfig> How I am trying to read it....: #include <GuiConstantsEx.au3> #include <adfunctions.au3> #include <Array.au3> #include <_XMLDomWrapper.au3> ; #include <_MSXML.au3> ; $FileList = _FileListToArray("C:\SUPPORT\SecXML\", "*.xml", 1) ; If @error = 1 Then ; MsgBox(0, "", "No Files\Folders Found.") ; Exit ; EndIf Local $sFile = "C:\SUPPORT\SecXML\Avaya-Softconsole_5.05.5_B2.0.xml" $xmlns = 'xmlns="http://tempuri.org/AppConfig.xsd"' If FileExists($sFile) Then $ret = _XMLFileOpen($sFile) if $ret =0 then Exit $desc = _XMLGetValue("/AppConfig/AppDetails/AppGroup") _ArrayDisplay($desc, "$desc as a 2D array") MsgBox(4096, $desc[0], $desc[1]) EndIf I am getting an error when I try to return the value of AppGroup. If I take out the namespace value from the xml then it works but obviously I don't want to do that. Can anyone please show the error of my ways?
  3. Hi all, I'm hoping someone will be able to help as I am not familiar at all with writing XML parsing scripts. Would I be able to extract the "Advertisement id" element from all entries where the attribute lastIsEnabled="false"? The furtherest I seem to get is opening the file Below is the topmost part of the xml file, I think what is tripping me up might be the Xpath syntax but I might be wrong. <SWD key="nNj2dmBGXlFJHWQneGzyWw=="> <Advertisements> <Advertisement id="{B2162A00-49DB-43FE-8F02-97B6F075D165}" name="WindowsXP-KB914388-x86-ENU.exe for MS06-036" version="6.0.6074.60" events="false" title="WindowsXP-KB914388-x86-ENU.exe for MS06-036" originator="NSInternal" package="{CD0F295B-3628-40A6-B4A6-11CF16F00E2D}" priority="Normal" available="2000-01-01 00:00:00" allowUserExecution="false" asap="false" runAtStartup="false" runAtLogon="false" retryAsap="true" notifyNewAdvert="0" notifyBeforeRun="0" notifyBeforeRunMaxDefer="0" immediateDownload="-2" minDownloadSpeed="-2" minRunSourceSpeed="-2" disableAfterRun="false" userOptional="false" recoverySnapshot="false" multicast="default"> <Description><![CDATA[]]></Description> <Status removed="true" discovered="2008-01-31 19:58:30" notified="true" hasRunSuccessfully="false" userEnabled="false" lastIsEnabled="false"/> </Advertisement> Would anyone be able to assist please?
  4. Aahh think I got it with your help: FileWriteLine($script_file, '$Return_Code = RunWait(@ComSpec & " /c " & "' & $CMD_var & '", @ScriptDir & "\Source", @SW_HIDE, 0) ;' & @CRLF) Thanks a lot!
  5. Cool that seems like an idea but let me just show in what context it is being used: $script_file = FileOpen($var & "\Compressed_Source\" & $package_name & ".au3", 10) FileWriteLine($script_file, "#include <GUIConstantsEx.au3>") FileWriteLine($script_file, "#include <WindowsConstants.au3>" & @CRLF) FileWriteLine($script_file, "#include <File.au3>" & @CRLF) FileWriteLine($script_file, "#include <7Zip.au3>" & @CRLF) FileWriteLine($script_file, "RunWait(@ComSpec & "" /c "" & ""C:\support\packages\" & $package_name & "\7za.exe x C:\support\packages\" & $package_name & "\Source\" & $package_name & ".7z -oC:\support\packages\" & $package_name & "\Source -y"", """", @SW_HIDE, 0) ;" & @CRLF) FileWriteLine($script_file, "Sleep(5000)" & @CRLF) FileWriteLine($script_file, "$Return_Code = RunWait(@ComSpec & "" /c """ & $CMD_var & ", @ScriptDir & ""\Source"", @SW_HIDE, 0) ;" & @CRLF) FileWriteLine($script_file, "" & @CRLF) FileWriteLine($script_file, "Sleep(5000)" & @CRLF) FileWriteLine($script_file, "DirRemove(""C:\support\packages\" & $package_name & "\Source"", 1)" & @CRLF) FileWriteLine($script_file, "Exit($Return_Code)" & @CRLF) FileWriteLine($script_file, "" & @CRLF) FileClose($script_file) Can you use the ConsoleWrite to insert lines into a file?
  6. Thanks for the reply. Below is actually what I want the output to be for the au3 file: $Return_Code = RunWait(@ComSpec & " /c " & "setup.msi /qr-", @ScriptDir & "\Source", @SW_HIDE, 0) ; setup.msi /qr- of course coming from $CMD_Var Does that make sense? For the life of me I cant get the script to create that line.
  7. Hi all, I've been using AutoIT quite a bit but first post on here. Sorry it is a problem for a first post I'm trying to have a au3 file created from inside a script but I'm unable to get my nested quoutes etc. sorted out and was hoping someone could tell me where I am going wrong please. FileWriteLine($script_file, "$Return_Code = RunWait(@ComSpec & "" /c """ & $CMD_var & ", @ScriptDir & ""\Source"", @SW_HIDE, 0) ;" & @CRLF) $CMD_Var needs to be populated here for use in the second script but the rest stay the same. Is producing: $Return_Code = RunWait(@ComSpec & " /c "setup.msi /qr-, @ScriptDir & "\Source", @SW_HIDE, 0) ; How do I go about using the quotes correctly? Help appreciated. Thanks
×
×
  • Create New...