Guys, I am working on an interface for a commandline tool that we have at work used to perform Windows profile refreshes. A part of the options that you put in the command are static such as the user ID, server name and printers but the hard part is the tokens. Those tokens are within the full user name field.
I need to find out how to put those tokens there only if they are checked with a checkbox. If they're not checked, nothing should appear in the final string.
Here is the code that I have so far, declaring all the string variables that I need:
CODE
Public Class Prof_refresh
Private Sub Close_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Close_btn.Click
Me.Close()
End Sub
Private Sub Prof_refresh_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub radioButtons_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Radio_Full.CheckedChanged, Radio_Partial.CheckedChanged
If Radio_Full.Checked = True Then Me.Refresh_type_box.Text = "ref" '<-hidden textbox
If Radio_Partial.Checked = True Then Me.Refresh_type_box.Text = "refp" '<-hidden textbox
End Sub
'\\Declaration of the tokens and passing text to boxes - THIS IS WHAT I NEED TO BE FLEXIBLE
Private Sub checkButtons_CheckChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles No_ACL.CheckedChanged, No_SNA.CheckedChanged, Save_Set.CheckedChanged, OVR.CheckedChanged
If No_ACL.Checked = True Then Me.No_ACL_Text.Text = "noacl" '<-hidden textbox
If No_SNA.Checked = True Then Me.No_SNA_Text.Text = "nosna" '<-hidden textbox
If Save_Set.Checked = True Then Me.Save_Set_Text.Text = "saveset1" '<-hidden textbox
If OVR.Checked = True Then Me.OVR_Text.Text = "ovr" '<-hidden textbox
End Sub
Private Sub Run_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Run_btn.Click
Me.Size = New System.Drawing.Size(604, 600)
ProfileRefresh()
End Sub
Public Function ProfileRefresh() As Boolean
Dim RefreshTypeVar As String = Me.Refresh_type_box.Text
Dim RefreshUserID As String = Me.UserID_text.Text
Dim RefreshServer As String = Me.Server_text.Text
Dim RefreshSrvInst As String = Me.Instance_text.Text
Dim RefreshUserName As String = Me.FullUserName.Text
Dim BWPrinters As String = Me.BW_printer.Text
Dim CLPrinters As String = Me.Color_printer.Text
Dim DefaultBW As String = Me.Defo_prnt.Text
Dim ProfRefreshProcess As New Process()
Dim ProfRefreshStartInfo As New ProcessStartInfo()
ProfRefreshStartInfo.FileName = "cmd.exe "
ProfRefreshStartInfo.WorkingDirectory = "C:\useradm\cut31"
'ProfRefreshStartInfo.UseShellExecute = False
'ProfRefreshStartInfo.CreateNoWindow = True
'\\Declaration of the command with all the options
ProfRefreshStartInfo.Arguments = "/D /c useradm.cmd " + RefreshTypeVar + " " + RefreshUserID + " " + RefreshServer + " " _
+ RefreshSrvInst + " " + """" + RefreshUserName + "{" 'here I should start to put the tokens <-
ProfRefreshProcess.EnableRaisingEvents = True
ProfRefreshProcess.StartInfo = ProfRefreshStartInfo
ProfRefreshProcess.Start()
End Function
End Class
Also, when the command is launched, I would like to send it's output to a multi-line textbox that is hidden until you press the "RUN!" button.
Anybody would want to help?
Thanks!
This post has been edited by tuxmeister: 30 Jun, 2008 - 06:25 PM