Snipplrhttp://snipplr.com/tags/cmd
Recent snippets posted on Snipplr.comen-usWed, 04 Mar 2015 07:38:01 GMT(DOS Batch) Batch script - sleep in milliseconds - deanhouseholderhttp://snipplr.com/view/73849/batch-script--sleep-in-milliseconds/
In DOS/cmd batch scripts it is not possible to issue a SLEEP command for less than 1 second. This script allows you to use a single batch script to double as a jscript (double-execution) in order to accomplish a single script/command that can specify sleep in milliseconds.
Usage:
Save script as a filename (not sleep.bat) such as millisleep.bat and put it in your path.
From within another batch script invoke it and pass in the number of milliseconds to sleep: (example below will sleep 250 milliseconds, which is 1/4th of a second)
millisleep.bat 250 ]]>Wed, 12 Mar 2014 10:22:58 GMThttp://snipplr.com/view/73849/batch-script--sleep-in-milliseconds/(PHP) Batch script to open an Administrator CMD shell - deanhouseholderhttp://snipplr.com/view/73847/batch-script-to-open-an-administrator-cmd-shell/
This batch script writes a temporary .vbs file which will invoke a UAC prompt to open an administrator command prompt. This makes it easy to create a shortcut to an admin prompt. ]]>Wed, 12 Mar 2014 10:09:08 GMThttp://snipplr.com/view/73847/batch-script-to-open-an-administrator-cmd-shell/(DOS Batch) cygwin open explorer window in current directory - peterlubczynskihttp://snipplr.com/view/54614/cygwin-open-explorer-window-in-current-directory/
Just run at the prompt cygwin bash $ cmd.exe /c start . ]]>Tue, 31 May 2011 03:44:06 GMThttp://snipplr.com/view/54614/cygwin-open-explorer-window-in-current-directory/(AppleScript) Applescript function - send CMD Command down key plus a letter keystroke - brandonjphttp://snipplr.com/view/50928/applescript-function--send-cmd-command-down-key-plus-a-letter-keystroke/
]]>Tue, 22 Mar 2011 02:06:21 GMThttp://snipplr.com/view/50928/applescript-function--send-cmd-command-down-key-plus-a-letter-keystroke/(Windows PowerShell) Copy files tree except some subfolders - AlexLocusthttp://snipplr.com/view/46288/copy-files-tree-except-some-subfolders/
Content of exclude file:
one exclude pattern per line. For me it contains single line:
.svn ]]>Thu, 30 Dec 2010 19:42:32 GMThttp://snipplr.com/view/46288/copy-files-tree-except-some-subfolders/(Windows PowerShell) Windows DIR - List only the filenames of all files in a directory - theonlyalteregohttp://snipplr.com/view/42589/windows-dir--list-only-the-filenames-of-all-files-in-a-directory/
I found this today and don't want too lose it. In windows the following command will create a text file named fileListing.txt which will contain a list of all the files in the current directory ( including fileListing.txt ) ]]>Wed, 20 Oct 2010 07:36:35 GMThttp://snipplr.com/view/42589/windows-dir--list-only-the-filenames-of-all-files-in-a-directory/(Other) Windows CMD open at specific location - dorseyehttp://snipplr.com/view/32198/windows-cmd-open-at-specific-location/
]]>Sat, 17 Apr 2010 23:35:42 GMThttp://snipplr.com/view/32198/windows-cmd-open-at-specific-location/(Bash) Howto run Tidy from the command line - noahhttp://snipplr.com/view/27758/howto-run-tidy-from-the-command-line/
This shell command will retrieve a Web page and validate the HTML with [Tidy, the HTML linter from the W3](http://tidy.sourceforge.net/). You can get an **XHTML validation** report right in your shell prompt, just like you'd get from the [Firefox extension](https://addons.mozilla.org/en-US/firefox/addon/249) or the [Web service.](validator.w3.org/). It's especially helpful when you need to **validate HTML on your intranet, or behind a firewall.**
### **NOTE: Curl does not follow redirects by default!**
By default, Curl retrieves *exactly* the URL you specify. The `-L` option causes Curl to follow redirects just like a Web browser would.
### **NOTE: Tidy produces a lot of output!**
Windows users should make sure their [command prompt screen buffer height is set to 9999](http://www.codinghorror.com/blog/archives/000334.html 'command prompt tips from Coding Horror') so that you don't "lose" any output.
### **Explanation of the command line options**
`curl -L` tells Curl to fo**LL**ow HTTP redirects
`curl -s` **S**uppresses Curl's annoying progress bar
`tidy -e` tells Tidy not to **E**mit the tidied HTML to the console
`tidy -q` tells Tidy to be **Q**uiet, instead of printing extra crap at the bottom of the report
### **Dependencies**
Curl and Tidy are installed via the [Cygwin setup.exe](http://cygwin.com/)
Alternately, Perl hackers could use [lwp-request](http://search.cpan.org/~gaas/libwww-perl-5.808/bin/lwp-request).
### **Doing more**
[Validate HTML with a stricter algorithm,](http://snipplr.com/view/4130/check-linked-pages-for-tidy-validation-errors-on-the-command-line/) using the OpenJade SGML parser.
[Validate linked pages](http://snipplr.com/view/4130/check-linked-pages-for-tidy-validation-errors-on-the-command-line/) with Tidy and lwp-request. ]]>Fri, 05 Feb 2010 12:41:54 GMThttp://snipplr.com/view/27758/howto-run-tidy-from-the-command-line/(Other) Command to Extract the Contents of an MSI File to a Folder - rengberhttp://snipplr.com/view/27182/command-to-extract-the-contents-of-an-msi-file-to-a-folder/
note, MSIExec /? will launch a dialog box with switch documentation. ]]>Wed, 27 Jan 2010 12:21:41 GMThttp://snipplr.com/view/27182/command-to-extract-the-contents-of-an-msi-file-to-a-folder/(Ruby) execute command and get cmd results - ogrellkhttp://snipplr.com/view/21677/execute-command-and-get-cmd-results/
]]>Fri, 23 Oct 2009 03:39:45 GMThttp://snipplr.com/view/21677/execute-command-and-get-cmd-results/(C) getopt example - tandourihttp://snipplr.com/view/18637/getopt-example/
]]>Fri, 21 Aug 2009 04:56:16 GMThttp://snipplr.com/view/18637/getopt-example/(C) checking command line arguments - tandourihttp://snipplr.com/view/18635/checking-command-line-arguments/
for checking the cmdargs ]]>Fri, 21 Aug 2009 04:33:53 GMThttp://snipplr.com/view/18635/checking-command-line-arguments/(PHP) Fork a process with PHP - ping_chhttp://snipplr.com/view/17622/fork-a-process-with-php/
]]>Wed, 29 Jul 2009 10:56:28 GMThttp://snipplr.com/view/17622/fork-a-process-with-php/(JavaScript) Running JScript in a CMD File - mitryhttp://snipplr.com/view/7485/running-jscript-in-a-cmd-file/
embed the JScript code in a .cmd file ]]>Fri, 25 Jul 2008 02:19:07 GMThttp://snipplr.com/view/7485/running-jscript-in-a-cmd-file/(Bash) Recursively unlock files in Mac OS X - wbowershttp://snipplr.com/view/5202/recursively-unlock-files-in-mac-os-x/
]]>Mon, 25 Feb 2008 22:42:02 GMThttp://snipplr.com/view/5202/recursively-unlock-files-in-mac-os-x/