How to change the icon of .bat file programatically?
I'd like to know what's the way to actually set the icon of a .bat file to an arbitrary icon. How would I go about doing that programmatically, independently of the language I may be using. ...
I'd like to know what's the way to actually set the icon of a .bat file to an arbitrary icon. How would I go about doing that programmatically, independently of the language I may be using. ...
I have a bunch of files that I need to be able to transport and install quickly. My current method for doing so is moving a flash drive with a readme file of where stuff goes whenever I need to move stuff, which is rather inelegant and cumbersome. My idea for a solution would be to write up a quick script to move files around that I cou...
I have found a few guides to be incomplete and hard to follow. Can I get a recommendation for a couple good guides on this subject? ...
Is it possible to somehow use a .bat file to script the schema and/or content of a SQL Server database? I can do this via the wizard, but would like to streamline the creation of this file for source control purposes. I would like to avoid the use of 3rd party tools - just limiting myself to the tools that come with SQL Server. ...
I needed to pass id and password to a cmd (or bat) file at the time of running rather than hardcoding them into the file. Here's how I do it. echo off fake-command /u %1 /p %2 Here's what the command line looks like: test.cmd admin P@55w0rd > test-log.txt The %1 applies to the first parameter the %2 (and here's the tricky part) ap...
Hi, I would like to use the built in windows ftp application to download some files on a periodic basis using a scheduled task and a .bat file. However I don't want to download the whole directory each time just the files that have changed or are new. Can this be done or do I need to write .NET application or the like? UPDATE: After ...
How do I make long commands go over multiple lines in a Vista/DOS batch file? ...
I need to copy the newest file in a directory to a new location. So far I've found resources on the forfiles command, a date-related question here, and another related question. I'm just having a bit of trouble putting the pieces together! How do I copy the newest file in that directory to a new place? ...
I'm looking to get the result of a command as a variable in a Windows batch script (see how to get the result of a command in bash for the bash scripting equivalent). A solution that will work in a .bat file is preferred, but other common windows scripting solutions are also welcome. ...
I want to wrap a perl one-liner in a batch file. For (trivial) example, in a unix shell I could quote up a command like this: perl -e 'print localtime() . "\n"' But DOS chokes on that with the helpful Can't find string terminator "'" anywhere before EOF at -e line 1. What's the best way to do this within a .bat? ...
While normally it's good to always choose the right language for the job, it can sometimes be instructive to try and do something in a language which is wildly inappropriate. It can help you understand the problem better. Maybe you don't have to solve it the way you thought you did. It can help you understand the language better. May...
As I understand it, .bat is the old 16-bit naming convention, and .cmd is for 32-bit Windows, i.e., starting with NT. But I continue to see .bat files everywhere, and they seem to work exactly the same using either suffix. Assuming that my code will never need to run on anyhting older than NT, does it really matter which way I name my ba...
I am working on a build system. The build system posts the results as a zip file in a directory. Unfortunately I have no easy way to know the name of the zip file, because it is timestamped. For the next operation, I must decompress this zip file to some specific location and then do some more file operations. I guess I could change ...
Can somebody remember what was the command to create an empty file in MSDOS using BAT file? ...
Hi, I want to create a .bat file so I can just click on it so it can run: svcutil.exe /language:cs /out:generatedProxy.cs /config:app.config http://localhost:8000/ServiceModelSamples/service Can someone help me with the structure of the .bat file? ...
I'm writing a simple .bat file and I've run into some weird behavior. There are a couple places where I have to do a simple if/else, but the code inside the blocks don't seem to be working correctly. Here's a simple case that demonstrates the error: @echo off set MODE=FOOBAR if "%~1"=="" ( set MODE=all echo mode: %MODE% ) else (...
Greetings, I've got a bat script which copies certain information from a computer onto a USB hard drive using Robocopy. The hard drive is FAT formatted and therefore doesn't support directories with extended attributes, leading me to robocopy error 282 as described here. How do I tell robocopy to copy all the attribute information EXC...
I have a nightly batch job that can tell if it has failed. I want it to send me an email, possibly with an attachment when it does. How can I send an email from a Windows Batch (.bat) file? ...
Hey All, Having read an existing post on stackoverflow and done some reading around on the net. I thought it was time to post my question before I lost too much hair! I have the following code within a batch file which I double click to run, under Windows XP SP3: SETLOCAL ENABLEDELAYEDEXPANSION ::Observe variable is not defined SET t...
How can I run a CMD or .bat file in silent mode? I'm looking to prevent the CMD interface from being shown to the user. ...