Jump to content

Mrugson

Member
  • Posts

    15
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Germany

About Mrugson

Mrugson's Achievements

0

Reputation

  1. jaclaz, thanks for the links - yeah not really what I was looking for but still regtime is very usefull I had to change the method anyway as .txt files exported from registry thru GUI show also parent keys as modified even if a single subkey was modified (which is logical of course but does not halp me). What the code does now is basically comparing 2 registry exports and putting results into output file - still some optimisation to do but works ok. Next step would be creating an installation package - btw this is the point of this whole app - get modified registry keys and files and build my own installation package for my custom OS installation. The problem I have now is that I am trying to use SevenZipSharp.dll with 7z.dll and obviusly would like to create a sfx installation package but cannot... From what I have read on CodePlex and other sites I should be able to use SevenZipSfx class but it seems like it is not there! I use SevenZipCompressor and Extractor just fine but can't use Sfx. This is what I got so far for the test extract/compress app which should provide sfx functionality: Imports SevenZip Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim zip As String = "D:\Instalki\Zip_DLLs\7z.dll" SevenZipExtractor.SetLibraryPath(zip) SevenZipCompressor.SetLibraryPath(zip) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Button2.Enabled = False BackgroundWorker1.RunWorkerAsync() End Sub Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork ExtractFile() End Sub Private Sub BackgroundWorker1_RunWorkerCompleted(ByVal sender As System.Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted Button2.Enabled = True End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click OpenFileDialog1.ShowDialog() TextBox1.Text = OpenFileDialog1.FileName End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Button4.Enabled = False BackgroundWorker2.RunWorkerAsync() End Sub Private Sub BackgroundWorker2_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker2.DoWork ArchiveFile() End Sub Private Sub BackgroundWorker2_RunWorkerCompleted(ByVal sender As System.Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker2.RunWorkerCompleted Button4.Enabled = True End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click OpenFileDialog2.ShowDialog() TextBox2.Text = OpenFileDialog2.FileName End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click Button6.Enabled = False BackgroundWorker3.RunWorkerAsync() End Sub Private Sub BackgroundWorker3_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker3.DoWork ArchiveFolder() End Sub Private Sub BackgroundWorker3_RunWorkerCompleted(ByVal sender As System.Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker3.RunWorkerCompleted Button6.Enabled = True End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click FolderBrowserDialog1.ShowDialog() TextBox3.Text = FolderBrowserDialog1.SelectedPath End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) FolderBrowserDialog1.ShowDialog() TextBox1.Text = FolderBrowserDialog1.SelectedPath End Sub 'PROCEDURES=========================================================================================================== Sub ExtractFile() Dim ext As New SevenZipExtractor(TextBox1.Text) ext.ExtractArchive(TextBox1.Text.Remove(TextBox1.Text.LastIndexOf("\"), TextBox1.Text.Substring(TextBox1.Text.LastIndexOf("\")).Length)) End Sub Sub ArchiveFile() Dim sZipFile As String = TextBox2.Text sZipFile = sZipFile.Remove(sZipFile.LastIndexOf("."), sZipFile.Substring(sZipFile.LastIndexOf(".")).Length) sZipFile = sZipFile & ".7z" Dim arch As New SevenZipCompressor() arch.CompressFiles(sZipFile, TextBox2.Text) End Sub Sub ArchiveFolder() Dim sZipFile As String = TextBox3.Text & ".7z" Dim arch As New SevenZipCompressor() arch.IncludeEmptyDirectories = True arch.DirectoryStructure = True arch.EncryptHeaders = True arch.PreserveDirectoryRoot = True arch.CompressDirectory(TextBox3.Text, sZipFile) End Sub End Class If I try using 7zsd.dll and copy /b command I get .exe file but when double-clicking it gives me "non 7z archive" error. Any help, please? mrugson
  2. allen2 thanks for your help but I need the VB code as a part of a bigger app so a tool will not do. What I have so far is simple app where you can import text files exported from registry via gui before and after installation of a given application, the code chcecks the modification times and then exports silently only the relevant keys and stores them as the application's keys. The perfect thing here would be for the code to export the text files itself so there is no "manual labor" necessary
  3. I am trying to export registry key to a text file using VB.NET code but what I get is what I would get in a .reg file but with .txt extension - I use regedit.exe with switches as a process. What I want is to export it to a .text file the same way as when using regedit.exe in gui mode. What is the most importatnt here is last accessed times for registry keys. I want to analyze differences between 2 states of registry and having last accessed times would be much easier thatn to compare 2 whole registries. I looked at various forums for some time and so far nothing. Any help much appreciated! Many thanks
  4. One of my users using HP Elitebook 8540p with nVidia Quadro NVS 510M has problems with some applications displaying on dual view. Main display is the laptop's screen (1366x768) and external HP screen is the secondary (1280x1024). The issue is that when for e.g. Lotus Notes window is moved to the external screen and user needs to open location menu from the right-hand side bottom of the window, if LN window is not maximized the menu appears on the laptop's screen (seems to be in the right place but on the wrong display), if LN window is maximized the menu is not showing (as probably outside of the laptop screen's area). All settings in nView Desktop Manager seem to be ok and set reposition dialogue boxes to application screen and disallow to be opened off-screen. I have installed the newest graphics driver I could find on nVidia website (260.99) but apart from better picture quality it did not change anything... Can anyone please advise?
  5. I finally managed to get it working properly and found a bit easier way of translating date & time to the intervals. As it will only be used in GMT time zone didn't need to use the 'lngBias'. Here's the code if anyone cares to look... Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork Dim startDate As String = New DateTime(Year(Today), Month(Today), 1, 0, 0, 0) Dim endDate As String = New DateTime(Year(Today), Month(Today), 1, 0, 0, 0).AddMonths(1).AddDays(-1) Dim dtmDateValue As String Dim dtmAdjusted As String Dim lngSeconds As String Dim startDate64Bit As String Dim endDate64Bit As String dtmDateValue = CDate(startDate) dtmAdjusted = DateAdd("n", 0, dtmDateValue) lngSeconds = DateDiff("s", #1/1/1601#, dtmAdjusted) startDate64Bit = CStr(lngSeconds) & "0000000" dtmDateValue = CDate(endDate) dtmAdjusted = DateAdd("n", 0, dtmDateValue) lngSeconds = DateDiff("s", #1/1/1601#, dtmAdjusted) endDate64Bit = CStr(lngSeconds) & "0000000" Dim dirEntry As DirectoryEntry = New DirectoryEntry dirEntry.Path = "LDAP://dc=TEAM,dc=vm,dc=com" dirEntry.Username = "Administrator" dirEntry.Password = "XXXXXXXX" Dim dirSearcher As New DirectorySearcher(dirEntry) dirSearcher.PropertiesToLoad.Add("DistinguishedName") dirSearcher.Filter = "(&(objectCategory=Person)(objectClass=User)(accountExpires>=" & startDate64Bit & ")(accountExpires<=" & endDate64Bit & "))" Dim results As SearchResultCollection results = dirSearcher.FindAll() Dim result As SearchResult Dim strUser As String Dim oFSO As Object = CreateObject("Scripting.FileSystemObject") Dim oFile As Object = oFSO.OpenTextFile("OutputFile.txt", 8, True) For Each result In results strUser = result.Properties("DistinguishedName")(0) MsgBox(strUser, MsgBoxStyle.Information, "strUser") oFile.Write(strUser & vbCrLf) Next End Sub allen2 - sorry if I appeard not to read the post you've provided a link to carefully... The method used to translate date & time was a bit to complicated for me to transform to VB.NET. Thank you very much for all your help!
  6. Ok, that works just great! Thanks a lot! One more thing though - I would need it to list all user accounts expiring current month whenever it is run so I would need some way of counting 100 nanoseconds intervals since 1/1/1601 to get the correct number into a variable and put it into the query filter. Do you know any easy way to do it? Cheers!
  7. Hello, I am trying to build a VB.NET application which is supposed to query AD and retrieve user account's expiration date and if account is expiring this month (or any given month for that matter) return DN of such account - target would be to write the data to spreadsheet for reporting purposes. So far I've tried two ways of doing it: 1) This one retrieves information from all user accounts in AD and then determines if any of the expiration dates falls within specified time frame. Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork 'create connection to AD Dim dirEntry As DirectoryEntry = New DirectoryEntry dirEntry.Path = "LDAP://dc=TEAM,dc=vm,dc=com" dirEntry.Username = "Administrator" dirEntry.Password = "XXXXXXXXX" 'search AD for all users and extract DN and AccountExpirationDate Dim dirSearcher As New DirectorySearcher(dirEntry) dirSearcher.PropertiesToLoad.Add("DistinguishedName") dirSearcher.PropertiesToLoad.Add("AccountExpirationDate") dirSearcher.Filter = "(&(objectCategory=person))" 'check AccountExpirationDate for each user found 'and check if account expires any day this month For i As Integer = 1 To 31 Dim results As SearchResultCollection results = dirSearcher.FindAll() Dim result As SearchResult For Each result In results If result.Properties("AccountExpirationDate")(0) = i & "/" & Month(Today) & "/" & Year(Today) & "" Then MsgBox(result.Properties("DistinguishedName")(0), MsgBoxStyle.Information, "Message") End If Next Next End Sub With this one I get completely nothing - it goes past the query but then behaves as if there were no accounts expiring even with expiration date set to 1/1/1970 it doesn't return anything (I've set a test account with appropriate expiration date) - does not give any error though... 2) This one is using AccountExpirationDate as filter - should be a bit faster. Again goes past query but doesn't return anything, no errors... Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork 'create connection to AD Dim dirEntry As DirectoryEntry = New DirectoryEntry dirEntry.Path = "LDAP://dc=TEAM,dc=vm,dc=com" dirEntry.Username = "Administrator" dirEntry.Password = "XXXXXXX" 'search AD for all users and extract DN and AccountExpirationDate 'searcg only for user accounts with AccountExpirationDate 'occuring any day this month For i As Integer = 1 To 31 Dim dirSearcher As New DirectorySearcher(dirEntry) dirSearcher.PropertiesToLoad.Add("DistinguishedName") dirSearcher.PropertiesToLoad.Add("AccountExpirationDate") dirSearcher.Filter = "(&(AccountExpirationDate=" & i & "/" & Month(Today) & "/" & Year(Today) & ")(objectCategory=person))" Dim results As SearchResultCollection results = dirSearcher.FindAll() Dim result As SearchResult For Each result In results MsgBox(result.Properties("DistinguishedName")(0), MsgBoxStyle.Information, "Message") Next Next End Sub I had some issues to get VBS AD doing exactly the same query working in past but once I got the date format correctly it works like a charm (tried the same here, also #date# and different formats but nothing worked). Now I need to put some GUI on top of it and I'd like to write the whole query in VB.NET rather than just getting the program to run VB scripts... Any help much appriciated, thanks in advance!
  8. Sorry for such a long delay... Yes, I've been trying to run it from a network share - finaly got to test it from a local drive on the server and works perfectly fine! Thanks a lot for your help and time!
  9. Sorry for the delay... Below I am posting latest code I wrote - this is supposed to uninstall Cisco VNP client using local admins credentials. Thing is it never goes further than the initial view of the form1, doesn't even run Form1_Load event. Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ProgressBar1.Hide() Button1.Hide() Button2.Hide() Button3.Hide() If My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{51FB15F4-AD27-43BC-AD4B-DD0354FB6BBD}", "DisplayName", "") <> "" Then Label2.Text = "Client present:" Label3.Text = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{51FB15F4-AD27-43BC-AD4B-DD0354FB6BBD}", "DisplayName", "") End If If Label2.Text = "" And Label3.Text = "" Then Label1.Text = "VPN client has not been found on this computer!" Button3.Show() Else Label1.Text = "Do you want to remove the below client?" Button1.Show() Button2.Show() End If End Sub -more code- Thanks in advance.
  10. Hi, I use Visal Basic 2008 Express Studio SP1 to create simple applications just cannot get them to run properly on Windows Server 2003 machines - work perfectly fine on XP SP2/SP3 PCs. As soon as the application runs, on the tile bar there is 'Internet' added in front of the actual title and baloon tip pops up saying: 'Microsoft .NET Security Warning. Never enter personal information or passwords into a window unless you can verify and trust the source of the request'. Each time the program is supposed to do something it fails. Can anyone advise? Thanks in advance!
  11. Cluberti, thank you very much for that. I was kind of hoping I won't have to recreate the PQs and re-install the drivers but that is what I am going to do now And thanks to your advise I think I know where the problem started... Much appriciated, cheers!
  12. Hello, I am a part of a support team for an estate of 4 global print servers (3 x Windows Server 2003 Standard Edition SP2, 1 x Windows Server 2000 SP4) with over a 1000 print queues setup on each one of them. The problem I have encountered recently is that some of the HP driver are failing, giving the below error message: "The 'HP Color LaserJet CP2020 PCL 6' printer driver is not installed on this computer. Some printer properties will not be accessible unless you install the printer driver. Do you want to install the driver now?" The most problematic of them is HP Color LaserJet CP2020 PCL 6 driver used for HP CLJ 2025dn as the device is a duplex printer and is supposed to be fast - HP Universal Printing PCL driver offers duplex printing but does not offer acceptable speed, HP Color LaserJet is faster but duplex is unavailable. It seems to fail even on small local print servers with only 4 PQs set up and 20+ drivers installed - I've created a test PQ on the server and it was working for one afternoon but next morning when I got onto the server I got the error message when trying to access printer properties. Have someone maybe encountered issue with that print driver or similar? Any help would be very much appriciated! Thanks a lot! Other printer drivers failing are: HP LaserJet 2200 PS HP OfficeJet Pro K8600 Series HP LJ P4010_P4510 Series PCL6 HP Color LaserJet 4600 PS HP Color LaserJet 4650 PS Driver file versions: UNIDRV.dll 6.0.6001.22127 (vistasp1_ldr.080302-0124) PSCRIPT5.dll 6.0.6001.22127 (vistasp1_ldr.080302-0124)
  13. Hi, Finally got it to work with IE.navigate("http://website?username=username&passwor=password")... CoffeeFiend, your method seems better but I hev some difficulties getting it to work properly eventhough I got the source code of the webiste. Any simple example code maybe to set me onto right track? Cheers anyway!
  14. It's not working for this particular website, thanks though. Tried to get the script to find 'input' fileds and fill them out but got lost as could not get names of the filedsfrom the site and finally managed to log in using 'wshshell.sendkeys' which is kind of primitive... Maybe you can advise something more universal? Thanks in advance.
  15. Hello, I am writing a simple VBS script that should, as one of its functions, open IE, go to a certail website and log user on to it with username and password saved within the script (password does not have to be encrypted in any way as the only purpose of the script is automation and it will be used by a single user only). So far I 've got somthing like this: Set wshShell = WScript.CreateObject ("WSCript.shell") Set IE = CreateObject("InternetExplorer.Application") IE.visible = 1 IE.navigate ("<logon website address>") The username and password for the website is not the same as credentials for Windows domain logon. Any help much appriciated...
×
×
  • Create New...