Build Visual Studio project through the command line

Create a .bat file called: Manual_MSBuild_ReleaseVersion.bat Put this in the .bat file. REM you’ll have to find the “latest” version of where msbuild.exe resides on your machine.. here are some popular versions/locations REM set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v2.0.50727 REM set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v3.5 REM set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v4.0.30319 REM set msBuildDir=C:\Program Files (x86)\MSBuild\12.0\Bin set msBuildDir=C:\Program Files (x86)\MSBuild\14.0\Bin call “%msBuildDir%\msbuild.exe” MySolution.sln /p:Configuration=Release /l:FileLogger,Microsoft.Build.Engine;logfile=Manual_MSBuild_ReleaseVersion_LOG.log … Read more

How do I execute a Shell built-in command with a C function?

If you just want to execute the shell command in your c program, you could use, #include <stdlib.h> int system(const char *command); In your case, system(“pwd”); The issue is that there isn’t an executable file called “pwd” and I’m unable to execute “echo $PWD”, since echo is also a built-in command with no executable to … Read more

Command binding Unable to cast object of type ‘System.Reflection.RuntimeEventInfo’ to type ‘System.Reflection.MethodInfo’

You don’t bind a command to the Click property. The Click property is for adding a traditional event handler to the Click event. You want to use the Command property to bind your command. <Button Content=”{Binding BackgroundMessage}” HorizontalAlignment=”Left” Width=”75″ VerticalAlignment=”Top” Height=”Auto” Margin=”2″ Command=”{Binding ElementName=MainGrid, Path=DataContext.AlertClickCommand}” CommandParameter=”{Binding}” />

How to run ” ps cax | grep something ” in Python?

See Replacing shell pipeline: import subprocess proc1 = subprocess.Popen([‘ps’, ‘cax’], stdout=subprocess.PIPE) proc2 = subprocess.Popen([‘grep’, ‘python’], stdin=proc1.stdout, stdout=subprocess.PIPE, stderr=subprocess.PIPE) proc1.stdout.close() # Allow proc1 to receive a SIGPIPE if proc2 exits. out, err = proc2.communicate() print(‘out: {0}’.format(out)) print(‘err: {0}’.format(err)) PS. Using shell=True can be dangerous. See for example the warning in the docs. There is also the … Read more

Linux zip command: add a file with different name [closed]

You can use zipnote which should come with the zip package. First build the zip archive with the myfile.txt file: zip archive.zip myfile.txt Then rename myfile.txt inside the zip archive with: printf “@ myfile.txt\n@=myfile2.txt\n” | zipnote -w archive.zip (Thanks to Jens for suggesting printf instead of echo -e.) A short explanation of “@ myfile.txt\n@=myfile2.txt\n”: From … Read more

How to split a file using a numeric suffix

Since the primary help from GNU split says: Usage: /usr/gnu/bin/split [OPTION]… [INPUT [PREFIX]] Output fixed-size pieces of INPUT to PREFIXaa, PREFIXab, …; default size is 1000 lines, and default PREFIX is ‘x’. With no INPUT, or when INPUT is -, read standard input. Mandatory arguments to long options are mandatory for short options too. -a, … Read more

Execute commands with notepad++

You can automatically add the current file using a variable in the execution string: C:\temp\test.exe “$(FULL_CURRENT_PATH)” The list of available variables is documented here. Examples: FULL_CURRENT_PATH = E:\My Web\main\welcome.html CURRENT_DIRECTORY = E:\My Web\main FILE_NAME = welcome.html NAME_PART = welcome EXT_PART = .html SYS.<var> e.g.: SYS.PATH = %PATH% CURRENT_WORD = <selection or word under cursor> CURRENT_LINESTR … Read more