Skip to content

Commit 82ccff8

Browse files
committed
First commit
1 parent 2bb7910 commit 82ccff8

22 files changed

+2125
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
# BatchToApp
2-
Program that allows you to pack your Batch scripts (.bat/.cmd) into a Windows applications!
2+
Program that allows you to pack your Batch scripts (`.bat`/`.cmd`) into a Windows applications! (`.exe`)
3+
4+
The script file after conversion can still:
5+
* Receive and process command line arguments
6+
* Return value of `%ERRORLEVEL%`
7+
8+
## Functionality
9+
**BatchToApp** can create 32 or 64 bit applications, with or without hiding the console. There are also completely unique script trimming functions that include:
10+
* Comments removing
11+
* Unnecessary characters removing

pics/1.png

629 KB
Loading

pics/2.png

629 KB
Loading

source/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
5+
</startup>
6+
</configuration>

source/BatchOptimizer.vb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Imports System.Text.RegularExpressions
2+
3+
Module BatchOptimizer
4+
Function RemoveBatchComments(source As String) As String
5+
source = Regex.Replace(source, "^\s*::.*$", "", RegexOptions.IgnoreCase Or RegexOptions.Multiline)
6+
source = Regex.Replace(source, "^\s*REM\s+.*$", "", RegexOptions.IgnoreCase Or RegexOptions.Multiline)
7+
8+
Return source
9+
End Function
10+
11+
Function TrimUnnecessaryCharacters(source As String) As String
12+
source = Regex.Replace(source, "^\s+", "", RegexOptions.Multiline)
13+
source = Regex.Replace(source, "\r?\n\r?\n+", "\r\n", RegexOptions.Multiline)
14+
15+
Return source
16+
End Function
17+
End Module

source/BatchToApp.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.9.34902.65
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "BatchToApp", "BatchToApp.vbproj", "{E107B54E-0064-4CD0-BD47-B5858DE2AFF5}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{E107B54E-0064-4CD0-BD47-B5858DE2AFF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{E107B54E-0064-4CD0-BD47-B5858DE2AFF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{E107B54E-0064-4CD0-BD47-B5858DE2AFF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{E107B54E-0064-4CD0-BD47-B5858DE2AFF5}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {DCBEDD03-556E-4017-B782-0ED00038B96B}
24+
EndGlobalSection
25+
EndGlobal

source/BatchToApp.vbproj

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{E107B54E-0064-4CD0-BD47-B5858DE2AFF5}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<StartupObject>BatchToApp.My.MyApplication</StartupObject>
10+
<RootNamespace>BatchToApp</RootNamespace>
11+
<AssemblyName>BatchToApp</AssemblyName>
12+
<FileAlignment>512</FileAlignment>
13+
<MyType>WindowsForms</MyType>
14+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
15+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
16+
<Deterministic>true</Deterministic>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<PlatformTarget>AnyCPU</PlatformTarget>
20+
<DebugSymbols>true</DebugSymbols>
21+
<DebugType>full</DebugType>
22+
<DefineDebug>true</DefineDebug>
23+
<DefineTrace>true</DefineTrace>
24+
<OutputPath>bin\Debug\</OutputPath>
25+
<DocumentationFile>
26+
</DocumentationFile>
27+
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
28+
</PropertyGroup>
29+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
30+
<PlatformTarget>AnyCPU</PlatformTarget>
31+
<DebugType>none</DebugType>
32+
<DefineDebug>false</DefineDebug>
33+
<DefineTrace>true</DefineTrace>
34+
<Optimize>true</Optimize>
35+
<OutputPath>bin\Release\</OutputPath>
36+
<DocumentationFile>
37+
</DocumentationFile>
38+
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
39+
<Prefer32Bit>false</Prefer32Bit>
40+
</PropertyGroup>
41+
<PropertyGroup>
42+
<OptionExplicit>On</OptionExplicit>
43+
</PropertyGroup>
44+
<PropertyGroup>
45+
<OptionCompare>Binary</OptionCompare>
46+
</PropertyGroup>
47+
<PropertyGroup>
48+
<OptionStrict>Off</OptionStrict>
49+
</PropertyGroup>
50+
<PropertyGroup>
51+
<OptionInfer>On</OptionInfer>
52+
</PropertyGroup>
53+
<PropertyGroup>
54+
<ApplicationIcon>icon.ico</ApplicationIcon>
55+
</PropertyGroup>
56+
<ItemGroup>
57+
<Reference Include="System" />
58+
<Reference Include="System.Data" />
59+
<Reference Include="System.Deployment" />
60+
<Reference Include="System.Drawing" />
61+
<Reference Include="System.Windows.Forms" />
62+
<Reference Include="System.Xml" />
63+
<Reference Include="System.Core" />
64+
<Reference Include="System.Xml.Linq" />
65+
<Reference Include="System.Data.DataSetExtensions" />
66+
<Reference Include="System.Net.Http" />
67+
</ItemGroup>
68+
<ItemGroup>
69+
<Import Include="Microsoft.VisualBasic" />
70+
<Import Include="System" />
71+
<Import Include="System.Collections" />
72+
<Import Include="System.Collections.Generic" />
73+
<Import Include="System.Data" />
74+
<Import Include="System.Drawing" />
75+
<Import Include="System.Diagnostics" />
76+
<Import Include="System.Windows.Forms" />
77+
<Import Include="System.Linq" />
78+
<Import Include="System.Xml.Linq" />
79+
<Import Include="System.Threading.Tasks" />
80+
</ItemGroup>
81+
<ItemGroup>
82+
<Compile Include="BatchOptimizer.vb" />
83+
<Compile Include="Compressor.vb" />
84+
<Compile Include="MainWindow.vb">
85+
<SubType>Form</SubType>
86+
</Compile>
87+
<Compile Include="MainWindow.Designer.vb">
88+
<DependentUpon>MainWindow.vb</DependentUpon>
89+
<SubType>Form</SubType>
90+
</Compile>
91+
<Compile Include="My Project\AssemblyInfo.vb" />
92+
<Compile Include="My Project\Application.Designer.vb">
93+
<AutoGen>True</AutoGen>
94+
<DependentUpon>Application.myapp</DependentUpon>
95+
<DesignTime>True</DesignTime>
96+
</Compile>
97+
<Compile Include="My Project\Resources.Designer.vb">
98+
<AutoGen>True</AutoGen>
99+
<DesignTime>True</DesignTime>
100+
<DependentUpon>Resources.resx</DependentUpon>
101+
</Compile>
102+
<Compile Include="My Project\Settings.Designer.vb">
103+
<AutoGen>True</AutoGen>
104+
<DependentUpon>Settings.settings</DependentUpon>
105+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
106+
</Compile>
107+
<Compile Include="BonfireUI.vb">
108+
<SubType>Component</SubType>
109+
</Compile>
110+
</ItemGroup>
111+
<ItemGroup>
112+
<EmbeddedResource Include="MainWindow.resx">
113+
<DependentUpon>MainWindow.vb</DependentUpon>
114+
</EmbeddedResource>
115+
<EmbeddedResource Include="My Project\Resources.resx">
116+
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
117+
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
118+
<CustomToolNamespace>My.Resources</CustomToolNamespace>
119+
<SubType>Designer</SubType>
120+
</EmbeddedResource>
121+
</ItemGroup>
122+
<ItemGroup>
123+
<None Include="My Project\Application.myapp">
124+
<Generator>MyApplicationCodeGenerator</Generator>
125+
<LastGenOutput>Application.Designer.vb</LastGenOutput>
126+
</None>
127+
<None Include="My Project\Settings.settings">
128+
<Generator>SettingsSingleFileGenerator</Generator>
129+
<CustomToolNamespace>My</CustomToolNamespace>
130+
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
131+
</None>
132+
<None Include="App.config" />
133+
</ItemGroup>
134+
<ItemGroup>
135+
<None Include="Resources\stub.cs" />
136+
</ItemGroup>
137+
<ItemGroup>
138+
<None Include="logo.png" />
139+
</ItemGroup>
140+
<ItemGroup>
141+
<Content Include="icon.ico" />
142+
</ItemGroup>
143+
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
144+
</Project>

0 commit comments

Comments
 (0)