Tag Info

Hot answers tagged

3

You need to write a batch file in Windows (in case of Linux they are called shell script). It is very easy to write once you know what commands to use (In your case you already know the commands). In a batch file you need to write down the commands in the order in which you want them to execute. To create a batch file, open a Notepad and write down those ...


3

As you have not provided your complete bat-file I guess that it is Powershell.exe -noexit -command "cd 'c:\Dev\ProductDev'" PowerShell -NoExit -Command "Write-Host 'node sp'" This is the wrong approach. You are first starting a Powershell which changes to the given directory and then stays open. If you exit this powershell the bat file will start the ...


2

Not the most beautiful solution, but it works. This script was tested on Linux Ubuntu. It may not work on a Mac because I use gawk. You need to save the following code in a file, e.g parsetext.sh Run this command to enable execution: chmod +x parsetext.sh Then run it with your inputfile.txt: ./parsetext.sh inputfile.txt Following is the script that ...


2

You can set the colours in the ~/.minttyrc file. Even better you can get a prebuilt theme from here: https://github.com/mavnn/mintty-colors-solarized Here is what I have in my ~/.minttyrc file: BoldAsFont=yes Transparency=off OpaqueWhenFocused=yes Columns=115 Rows=34 Term=xterm BackspaceSendsBS=yes Font=Consolas BellFlash=yes Locale=en_GB Charset=UTF-8 ...


2

I know this one was answered a long time ago, however this is my script to simulate the locate function used in unix/linux Save this as locate.bat and place in System32 OR run from directory it's stored in. Takes one parameter like this "cmd> locate javac.exe" The locate /c switch (as a 2nd parameter will count the number of instances ) and locate /? will ...


1

I wrote a proper ip4 command out of similiar frustration. ip4 (.exe is here)


1

In general in gnuplot there are at least 5 mode to make persistent the execution of a script, from inside and from command line Put a pause -1 after the plot command in the file, or at the file end. Use command gnuplot filename.gp - (yes, dash is the last parameter) to stay in the interactive regime when the script completes. Run gnuplot as gnuplot ...


1

If I understand the question correctly this will get you what you want. This is PowerShell: $FireWall = New-Object -comObject HNetCfg.FwPolicy2 $EnableRules = $FireWall.rules | Where-Object {$_.LocalPorts -like "*3389*" -and $_.Profiles -eq "3"} ForEach ($Rule In $EnableRules){$Rule.Enabled = "True")} This will filter out the rules and grab the correct ...


1

You could use RunHiddenConsole hideExec.bat @echo off RunHiddenConsole batch.bat


1

This works nicely, I use it mostly with psexec when inspecting client computer connections. nslookup myip.opendns.com resolver1.opendns.com


1

you can use rmdir to delete the files and subfolder, like this: rmdir /s/q MyFolderPath However, it is significantly faster, especially when you have a lot of subfolders in your structure to use del before the rmdir, like this: del /f/s/q MyFolderPath > nul rmdir /s/q MyFolderPath


1

It seems a work for awk. It allows somehow the use of associative multidimensional arrays. The following bash script should do the work. awk ' { Nb[$1]++;b[$1][Nb[$1]]=$2 } END{ for (i in Nb) { printf("%s ", i); for (j = 1 ; j<=Nb[i]; j++) printf("%ld ", b[i][j]); printf(" \n") ; } ...


1

how can i write the line that contains such character and also the previous line Use -B1. For example: $ seq 10 >file $ grep -B1 5 file 4 5 If you want to include the file's name, that add -H: $ grep -HB1 5 file file-4 file:5 Combined with find Assuming that you have either GNU find or a modern BSD find, then your complete command can be ...


1

for /f "tokens=1,4*" %a in ('netsh interface ipv4 show interface') do @echo %a %c


1

You could try: { foo; echo contents not stored in file; } | bar or (almost the same, but starts a subshell): ( foo; echo contents not stored in file ) | bar Edit: A totally different approach, closer in design to what you were looking for: foo | cat - <(echo additional contents) | bar See "Process substitution" in bash's manual.



Only top voted, non community-wiki answers of a minimum length are eligible