Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Batchfile

Run all files in current folder bat file

1
2
3
:: Run all files in current folder
:: No spaces in files' names! (Except this bat file name - so it won't start files forever in recursion)
for /r %%i in (*) do start %%i
https://snipt.net/embed/8ab47e79080e32d0f41c876afdd02bc8/
https://snipt.net/raw/8ab47e79080e32d0f41c876afdd02bc8/
8ab47e79080e32d0f41c876afdd02bc8
bat
Batchfile
3
2016-12-09T18:16:24
True
False
False
Feb 12, 2013 at 01:25 PM
/api/public/snipt/53825/
run-all-files-in-current-folder-bat-file
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="p">:</span><span class="c1">: Run all files in current folder</span> </span><span id="L-2"><a name="L-2"></a><span class="p">:</span><span class="c1">: No spaces in files&#39; names! (Except this bat file name - so it won&#39;t start files forever in recursion)</span> </span><span id="L-3"><a name="L-3"></a><span class="k">for</span> /r <span class="se">%%</span>i <span class="k">in</span> <span class="p">(</span>*<span class="p">)</span> <span class="k">do</span> <span class="k">start</span> <span class="se">%%</span>i </span></pre></div> </td></tr></table>
batch, file

Text only

Playlist

dir /s /O:N /B *.flac > playlist.m3u
https://snipt.net/embed/5e52fbf5fd0cb1e32bfa9d40d4a2f855/
https://snipt.net/raw/5e52fbf5fd0cb1e32bfa9d40d4a2f855/
5e52fbf5fd0cb1e32bfa9d40d4a2f855
text
Text only
1
2016-12-07T15:32:44
True
False
False
/api/public/snipt/42266/
-316
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>dir /s /O:N /B *.flac &gt; playlist.m3u </span></pre></div> </td></tr></table>
batch

Batchfile

Sleep in batch

:Pause the program until -w (miliseconds) passes
PING 1.1.1.1 -n 1 -w 60000 >NUL
https://snipt.net/embed/41a53943d52a27684212fc8fd18616ec/
https://snipt.net/raw/41a53943d52a27684212fc8fd18616ec/
41a53943d52a27684212fc8fd18616ec
bat
Batchfile
2
2016-12-09T13:04:29
True
False
False
/api/public/snipt/35473/
sleep-in-batch
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="p">:</span><span class="nl">Pause</span><span class="c1"> the program until -w (miliseconds) passes</span> </span><span id="L-2"><a name="L-2"></a>PING 1.1.1.1 -n 1 -w 60000 <span class="p">&gt;</span>NUL </span></pre></div> </td></tr></table>
batch, sleep, windows

Batchfile

Sync time with DC

1
2
3
4
REM The following script will check and resync the time with the main domain controller
@echo off
net time
net time /set /yes
https://snipt.net/embed/a47be8b2f7fb363615615ed277f95ca2/
https://snipt.net/raw/a47be8b2f7fb363615615ed277f95ca2/
a47be8b2f7fb363615615ed277f95ca2
bat
Batchfile
4
2016-12-09T03:43:11
True
False
False
Aug 02, 2012 at 09:57 AM
/api/public/snipt/34638/
sync-time-with-dc
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1">REM The following script will check and resync the time with the main domain controller</span> </span><span id="L-2"><a name="L-2"></a><span class="p">@</span><span class="k">echo</span> off </span><span id="L-3"><a name="L-3"></a>net time </span><span id="L-4"><a name="L-4"></a>net time /set /yes </span></pre></div> </td></tr></table>
batch

Batchfile

show programs using ports

netstat -a -n -b -p tcp
https://snipt.net/embed/41a3f145882f9f46db686a1a11032327/
https://snipt.net/raw/41a3f145882f9f46db686a1a11032327/
41a3f145882f9f46db686a1a11032327
bat
Batchfile
1
2016-12-10T17:07:45
True
False
False
/api/public/snipt/32930/
show-programs-using-ports
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>netstat -a -n -b -p tcp </span></pre></div> </td></tr></table>
batch, server, windows

Batchfile

create file with date and time on name

1
2
3
4
5
6
@echo off

set hora=%time:~0,2%%time:~3,2%%time:~6,2%
set data=%date:~0,2%%date:~3,2%%date:~6,4%

php --version > version_%data%_%hora%.txt
https://snipt.net/embed/8cea93cb6a41d5ab9ebdeaac9b9a4d67/
https://snipt.net/raw/8cea93cb6a41d5ab9ebdeaac9b9a4d67/
8cea93cb6a41d5ab9ebdeaac9b9a4d67
bat
Batchfile
6
2016-12-08T08:02:01
True
False
False
/api/public/snipt/32174/
create-file-with-date-and-time-on-name
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="p">@</span><span class="k">echo</span> off </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="k">set</span> <span class="nv">hora</span><span class="p">=</span><span class="nv">%time:~0,2%%time:~3,2%%time:~6,2%</span> </span><span id="L-4"><a name="L-4"></a><span class="k">set</span> <span class="nv">data</span><span class="p">=</span><span class="nv">%date:~0,2%%date:~3,2%%date:~6,4%</span> </span><span id="L-5"><a name="L-5"></a> </span><span id="L-6"><a name="L-6"></a>php --version <span class="p">&gt;</span> version_<span class="nv">%data%</span>_<span class="nv">%hora%</span>.txt </span></pre></div> </td></tr></table>
batch, cmd, windows
Copyrighted, illegal, or inappropriate content? Email [email protected].