Skip to content

Commit

Permalink
0.4: add support for run command minimized and run invisible.
Browse files Browse the repository at this point in the history
  • Loading branch information
M1kerochip committed May 17, 2020
1 parent 50fa5b9 commit 2cdd391
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("1.1.0.0")>
<Assembly: AssemblyFileVersion("1.1.0.0")>
<Assembly: AssemblyVersion("1.4.1.0")>
<Assembly: AssemblyFileVersion("1.4.1.0")>
1 change: 1 addition & 0 deletions frmMain.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 14 additions & 3 deletions frmMain.vb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Imports System.ComponentModel


Public Class frmMain
Public Declare Function Wow64DisableWow64FsRedirection Lib "kernel32" (ByRef oldvalue As Long) As Boolean

Expand All @@ -24,13 +25,21 @@ Public Class frmMain

For Each s As String In txtFileList.Lines
If System.IO.File.Exists(s) Then 'Check file exists (or has been created, if reading from GW)

Dim noext As String = ControlChars.Quote + System.IO.Path.GetDirectoryName(s) + "\" + System.IO.Path.GetFileNameWithoutExtension(s) + ControlChars.Quote
Dim hasext As String = ControlChars.Quote + s + ControlChars.Quote
If txtCmd.Text.Trim <> "" Then 'Check script exists
Dim xp As New Process
If chkRunMinimized.Checked Then
xp.StartInfo.WindowStyle = ProcessWindowStyle.Minimized
If chkRunMinimized.CheckState = CheckState.Indeterminate Then
xp.StartInfo.UseShellExecute = False
xp.StartInfo.CreateNoWindow = True
Else
xp.StartInfo.WindowStyle = ProcessWindowStyle.Minimized
End If
End If
xp.StartInfo.FileName = txtCmd.Text.Trim
xp.StartInfo.Arguments = txtParams.Text.Replace("%FILENAME", ControlChars.Quote + s + ControlChars.Quote)
xp.StartInfo.Arguments = txtParams.Text.Replace("%FILENAME", hasext).Replace("%NOEXTFILENAME", noext)
xp.Start()
If chkWaitForExit.Checked Then xp.WaitForExit()
End If
Expand All @@ -55,6 +64,8 @@ Public Class frmMain
End Sub

Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles Me.Load
Me.Text = "Execute Multiple Files v" + My.Application.Info.Version.ToString

chkClearAfterExecute.Checked = My.Settings.CleafAfterExec
chkOverWriteOnDragDrop.Checked = My.Settings.ClearAfterDrag
txtCmd.Text = My.Settings.Exec
Expand All @@ -64,7 +75,7 @@ Public Class frmMain
chkWaitForExit.Checked = My.Settings.WaitForExit
chkRunMinimized.Checked = My.Settings.RunMinimized

ToolTipMain.SetToolTip(txtParams, "Place command line arguments here. %FILENAME is the variable for the files in the list above.")
ToolTipMain.SetToolTip(txtParams, "Place command line arguments here. %FILENAME is the variable for the files in the list above. %NOEXTFILENAME is the variable for the file with no extension")
ToolTipMain.SetToolTip(txtCmd, "Command to execute. Command line may include spaces etc.")
ToolTipMain.SetToolTip(btnClearList, "Clear the list now.")
ToolTipMain.SetToolTip(btnExecute, "Execute the command in the command box.")
Expand Down

0 comments on commit 2cdd391

Please sign in to comment.