Popular Batch recipes tagged "windows"http://code.activestate.com/recipes/langs/batch/tags/windows/2015-12-27T20:45:32-08:00ActiveState Code RecipesPublish a Windows Process List to PDF with xtopdf (Batch)
2015-12-27T20:45:32-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/579142-publish-a-windows-process-list-to-pdf-with-xtopdf/
<p style="color: grey">
Batch
recipe 579142
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/pdf/">pdf</a>, <a href="/recipes/tags/pdfwriter/">pdfwriter</a>, <a href="/recipes/tags/pdf_generation/">pdf_generation</a>, <a href="/recipes/tags/processes/">processes</a>, <a href="/recipes/tags/process_management/">process_management</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/windows/">windows</a>).
</p>
<p>This recipe shows how you can generate a Windows process list or task list (basically, a list of running processes, with some information about each of them), to a PDF file, using the Windows TASKLIST command along with the xtopdf toolkit. The list is sorted in ascending order of memory usage of the processes, before writing it to PDF.</p>
<p>It differs somewhat from other xtopdf recipes, in that no additional code needs to be written, over and above what is already in the xtopdf package. We just have to use the needed commands there, in a series of commands or a pipeline.</p>
<p>However, one can still write additional code, by modifying the program used (StdinToPDF.py), if needed, to customize the PDF output.</p>
A SOX 1KHz Sinewave Generator Using A Windows, (TM), Batch File... (Batch)
2013-05-02T17:48:18-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578516-a-sox-1khz-sinewave-generator-using-a-windows-tm-b/
<p style="color: grey">
Batch
recipe 578516
by <a href="/recipes/users/4177147/">Barry Walker</a>
(<a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/sound/">sound</a>, <a href="/recipes/tags/sound_exchange/">sound_exchange</a>, <a href="/recipes/tags/sox/">sox</a>, <a href="/recipes/tags/windows/">windows</a>).
</p>
<p>32 bit Windows to Windows 7...</p>
<p>This batch file generates a 65536 byte binary file to give 8 seconds of pure sinewave at the earphone/speaker output(s)...</p>
<p>It uses ONLY a default Windows 32 bit installation, to Windows 7, except for the installation of SOX...</p>
<p>Obtain SOX from here:-</p>
<p><a href="http://sox.sourceforge.net/" rel="nofollow">http://sox.sourceforge.net/</a></p>
<p>Notepad was the _main_ editor... ;o)</p>
<p>Hopefully the code section does NOT corrupt the binary part which is 8 bytes in size.
If it does then let me know on here and I will post a pointer from where to grab it...</p>
<p>Enjoy...</p>
Batch Local Network Messaging System (Batch)
2012-02-03T01:41:41-08:00Alexander James Wallarhttp://code.activestate.com/recipes/users/4179768/http://code.activestate.com/recipes/578028-batch-local-network-messaging-system/
<p style="color: grey">
Batch
recipe 578028
by <a href="/recipes/users/4179768/">Alexander James Wallar</a>
(<a href="/recipes/tags/alex/">alex</a>, <a href="/recipes/tags/batch/">batch</a>, <a href="/recipes/tags/batch_file/">batch_file</a>, <a href="/recipes/tags/dos/">dos</a>, <a href="/recipes/tags/messaging/">messaging</a>, <a href="/recipes/tags/messenger/">messenger</a>, <a href="/recipes/tags/network/">network</a>, <a href="/recipes/tags/wallar/">wallar</a>, <a href="/recipes/tags/windows/">windows</a>, <a href="/recipes/tags/wired/">wired</a>, <a href="/recipes/tags/wired_network/">wired_network</a>).
Revision 3.
</p>
<p>This is a Batch Local Messaging System that can be used to send messages between computers that share the same file system.</p>
<p>There are three files in the code below. They are separated with dashed lines. There is a comment on the top of each segment of code indicating the file name that the code needs to be saved as. They need to be saved as three separate batch files in the same folder. </p>
<p>The first file, MessengerMain.bat will ask you for your name and then an address. The name should be whatever you wish your screen name to be. The address needs to be the path of the FOLDER that is shared between you and the other computer that you are communicating with. Once these pieces of information are entered, two screens will appear. The first is the Sender screen and the other is the Receiver screen. </p>
<p>How does it work?
The MessengerMain.bat file will create two text files, Name.txt and Address.txt, that will hold your user name and the common folder address. It will then use the START command to run Sender.bat and Receiver.bat. Sender.bat will create a text file named msgtext.txt in the address folder you specified in MessengerMain.bat. If there is already a file of this sort in existence in the address folder, it will overwrite it. Once this file is created, any message you enter will be saved in the msgtext.txt file after the name you entered (%name%: %msg%). Sender.bat the CLS (clears) the screen and asks you for another message continuously. Receiver.bat is very similar. Receiver.bat, first off, reads the Address.txt file and the Name.txt file to find your information given in MessengerMain.bat just like Sender.bat does. It will count the number of lines in the msgtext.txt file and will clear the whole screen and print out the whole contents of the file if the number of lines in msgtext.txt increases. So basically you are writing to a shared file and reading from a shared file. </p>
<p>Example:</p>
<p>I have a folder called MSGFolder located in the folder as I have my MessengerMain.bat, Receiver.bat, and Sender.bat files. I then run MessengerMain.bat by double clicking on the icon. I enter Alex for my Name and MSGFolder as the Address. I then double click MessengerMain.bat again and enter the name Bob for Name and MSGFolder for Address. Once you do this you can type in either of the Sender.bat interfaces and it will show up as if you are talking. </p>