• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Directory is invalid VB.net

Smoblikat

Diamond Member
Hello, so I am pulling my hair out at this and im hoping I can get some help. Im writing a little program that allows users to install google chrome on their own machines without us having to go over and put in our admin passwords. The general flow is that I have a .net app which houses the offline chrome installer, and automagically passes it my admin credentials. The .net app is located on a server on our LAN. the code is
Code:
        Dim cName As String = (System.Environment.MachineName)
        File.WriteAllBytes("\\" + cName + "\C$\users\public\" & "Chrome.exe", My.Resources.Chrome)

        Dim domain As String = "myDomain"
        Dim uName As String = "myUsername"
        Dim pass As String = "myPassword"
        Dim passString As System.Security.SecureString = New System.Security.SecureString()
        For Each c As Char In pass
            passString.AppendChar(c)
        Next
        Threading.Thread.Sleep(10000)
        Process.Start("\\" + cName + "\C$\users\public\" & "Chrome.exe", uName, passString, domain)
I tried just doing "C:\users\public" as the process.start location but I got a similar error, so I figured it was trying to run it from the servers user folder, so I explicitly stated to use the local machine as the directory. The strange thing is, it copies the installer to the folder perfectly, if I go to the public folder on the local machine I can see Chrome.exe, but then it fails at running it. If I take the .net app and copy it locally and run it, the program works perfectly. Any help would be greatly appreciated.

EDIT - The threading.sleep thing is just there to test, I want to make sure the file has enough time to be written before I execute it, which it does.
 
Last edited:
-Only admins have access to the admin share c$. You would need to create a share that users can access
-This is bad security as users can decompile the exe to see the password or rename any file they want to chrome.exe and have it run it as an admin.

Custom scripts are no replacement for a good pc management suite like SMS or altiris. If you are really looking to avoid pc management suites then i would use something like psexec https://technet.microsoft.com/en-us/sysinternals/bb897553.aspx before i implemented my own tool.
 
Last edited:
Back
Top