Sometimes you have to embed passwords, user names, phone numbers, etc. in a batch file you'd rather not make publicly visible. You don't need it truly hidden, you just don't want it to be obvious. Here are a few approaches you can take. For even greater security, you can use a combination of several of these techniques: 1 - If you look around in your favorite program archive, you might find a program called "bat2exe", "bat2com", or something similar. Try the free PC Magazine "bat2exec.exe" you'll find in the "antique" utility collection here: ftp://ftp.pcmag.com/archives/antique/antique.zip Or at simtel as "bat2ex15.zip" here: http://www.simtel.net/product.download.mirrors.php?id=40551 This will "compile" your batch program into a COM file. If you need to convert a COM file into an EXE file, get "c2e_e2c.zip" from here: http://www.simtel.net/product.download.mirrors.php?id=27308 Another batch file "compiler" that actually creates self-extracting archives is batcomp: http://bdargo.com/info/batcomp.htm Because batcomp doesn't really compile your batch file, you have to take care to use "compatible" batch code. However, batcomp embeds a "helper" program which works on all platforms and solves many problems. TurboBat creates true com files and is well documented. Get TurboBat here: http://www.simtel.net/product.download.mirrors.php?id=40684 True compiled batch programs are only good for very simple batch files, so try to compile just the bare minimum code you need. After you've compiled your batch file, you may want to use a program compressor on it to help hide internal text. For DOS programs, PKLITE and TINYPROG are popular. You can find lots of DOS program compressors here: http://www.simtel.net/category.php?id=104 ftp://ftp.cdrom.com/pub/simtelnet/msdos/execomp/ Another popular compressor that supports DOS and Windows is UPX: http://upx.sourceforge.net/ Another good program used to convert COM files into something with no recognizable internal text is "netrun31.zip" here: http://www.simtel.net/product.download.mirrors.php?id=43214 2 - Create a Shell Archive. It's kind of like a zip file in that it can hold another file inside, but unlike a zip file, a shell archive doesn't need anything but standard batch commands to extract the original file. You put your "secure" batch file inside a shell archive, then add whatever other code you need. To create the shell archive, you need Windows Scripting. This comes pre-installed on Win98 and newer. If you have Win98 or NT, you should upgrade. What came on the CDs and service packs isn't good enough: Win98 and newer: http://msdn.microsoft.com/downloads/list/webdev.asp Win95: You're going to have to find a copy of scripting ver 5.1: http://www.microsoft.com/downloads/details.aspx?FamilyID=bfdb7709-51e4-4aa6-adb0-05444e68dd80 I have a "shar" (shell archive) creation script here: http://www.ericphelps.com/scripting/samples/shar/DosBatch/ You drop your batch file on the "shar.vbs" script, and it will create a batch self-extractor. Then you just modify the resulting code to suit your needs. For example, remove all the user prompts and add code to automatically run and delete the extracted file. 3 - Hide in plain sight by converting your batch file into a scrap. I know a couple Visual Basic Script email viruses that used this method to hide. It worked too! One way to do it is to run the packager.exe program (it's in your Windows folder), select "Import" from the "File" menu and select your batch file. Then select "Copy Package" from the edit menu. Now switch to Explorer and paste the item into your desired folder. It will be named "scrap", but you can rename it to whatever you want. To run it, you'll have to know it's REAL short file name (like SCRAP.SHS) and use the START command. For example: start /w scrap.shs Of course, double-clicking it also works. Very few people know what a scrap is let alone know how to find out what is hiding in one. 4 - You can create a self extracting exe (SFX) with your batch file in it. Many SFX creators can be set up to automatically extract your batch file, run it, then delete the extracted batch file when it finishes. It may be obvious to you and me, but many people have no idea how to open a self-extracting zip file to look at the files inside. Check out the WinZip Self-Extractor at or the flexible (and free) SFX Maker at . If you want a finished product that looks like an installer, try the free and open-source Free Extractor at . If you want to make looking inside more difficult, try using something other than the ubiquitous zip format. For example, the "7z" format from or the "rar" format from . And -- just to make it more difficult to look inside, after you build your SFX, you can use a Windows program compressor to make your file unrecognizable to the original creation utility (so even if you use WinZip to create it, WinZip won't be able to open it). Try the free open-source UPX program at . 5 - Look in any software archive for a file encrypter. Then you can encrypt your batch file and store it encrypted. You'll need another batch file that will decrypt your batch file, run it, then delete the decrypted version when finished. Because the secondary batch file will have the name of the decryption program, the name of your encrypted file, and the password needed to decrypt it, all you've really done is make someone take two extra steps before reading what you wanted hidden. At a minimum you should rename your decryption program so it doesn't look interesting. And do the same with your encrypted batch file name, the unencrypted temporary name, and the decryption password: linefeed.exe index.dat ~temp3.bat -crlf call ~temp3.bat del ~temp3.bat In the above example, "linefeed.exe" is the decryption program, index.dat is the encrypted file, "~temp3.bat" is the unencrypted batch file, and "-crlf" is the password. If it doesn't look like a decryption program, nobody will be tempted to run it. 6 - Change the name of the batch file to "printer.sys" or some other unexciting name. Put it in an unexciting place like a folder under the system directory. Nobody will think of opening it. Have another batch file copy the "printer.sys" file over to a real BAT file name, run it, and delete the copy when finished. 7 - Last (because it isn't a batch solution), you might want to look at AutoIt from http://www.hiddensoft.com/. It's a keystroke automater on steroids. The reason it's mentioned is that it can compile it's scripts into a combined single executable.