Skip to content

Commit

Permalink
Add bat file for quick create lnk in the startup folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
DrGennadius committed Nov 15, 2021
1 parent 2f5c916 commit af47034
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
6 changes: 6 additions & 0 deletions GSimpleWinSleepPreventer/GSimpleWinSleepPreventer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,11 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="..\scripts\create_link_in_startup.bat">
<Link>create_link_in_startup.bat</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
4 changes: 2 additions & 2 deletions GSimpleWinSleepPreventer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.3.2.0")]
[assembly: AssemblyFileVersion("0.3.2.0")]
[assembly: AssemblyVersion("0.3.3.0")]
[assembly: AssemblyFileVersion("0.3.3.0")]
13 changes: 13 additions & 0 deletions scripts/create_link_in_startup.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@echo off

set SCRIPT="%TEMP%\%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%.vbs"

echo Set oWS = WScript.CreateObject("WScript.Shell") >> %SCRIPT%
echo sLinkFile = "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\GSimpleWinSleepPreventer.lnk" >> %SCRIPT%
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> %SCRIPT%
echo oLink.TargetPath = "%~dp0\GSimpleWinSleepPreventer.exe" >> %SCRIPT%
echo oLink.Arguments = "-s" >> %SCRIPT%
echo oLink.Save >> %SCRIPT%

cscript /nologo %SCRIPT%
del %SCRIPT%

0 comments on commit af47034

Please sign in to comment.