October 16th, 2001, 02:56 PM
DOS Unleashed - DOS for the 3l33t
I've read a lot of 'newbies DOS-guides' lately. I guess some of you should be ready for the 3l33t stuff by now... So, here's 'Dos Unleashed' for all of you Windows-bashers
October 16th, 2001, 05:52 PM
October 16th, 2001, 05:55 PM
Good post Negative :-)
Maybe you answer a question thats been bothering me for a while...
When using command lines for scripting, you sometimes need to set a variable %Rootdrive% to be a users home directory, but, knowing that batch files are not able to use 2 variables as a piece of data - and the home directory is a combination of server name and home directory name, its necessary to use Subst command to consolidate the two variables (Subst %RootDrive% %HomeDrive% %HomePath%) - Now, maybe i'm being stupid but do we not use 2 variables to create the consolidated value - because we can't use 2 variables!!!
Hope you can shed some light on this for me, i can't seem to get my head round it!
October 16th, 2001, 07:09 PM
Batch to Exec
Ok, here is the program. It was a freeware thing released 11 years ago, ok don't laugh at me, I'm not that old, anyway it was cool then and it's cool now
Here is how it works (sorry lost the documentation long ago)
Take your batch file, we will call this example foo.bat
It does something useful, cool, maybe looks like a password login or something. You want to make it an exec file so people can just open up notepad and steal your hard work, heh.
Put the bat2exec.com on your hard drive somewhere, doesn't matter where (temp directory would be a good idea). Copy the batch file into the same directory. Simply type the program name, a space, and the batch file name and it will make one with the *.com extention.
==> becomes foo.com
Foo.bat and Foo.com do the exact same thing except now it's an exec file. This was useful for making password prompts out of batch files, but you didn't want someone to just edit the file and see what the password was. This was useful decades ago
October 16th, 2001, 08:13 PM
Thx for the reply I got
Im' not sure what you mean with your question, but about the batch-file variables: you actually can use up to 9 variables when it comes to batch-filing (%1 to %9). %0 has a special meaning: it's the batch file's name.
This is what I think you mean: you need to set the environment variable Rootdrive (%rootdrive%), and that variable consists of (the variables) %Homedrive% and %Homepath%. You indeed can't (as far as I know) consolidate those two variables using a batch-file.
But u can use the parameters of a batchfile.
Let's say you want the environment variable to be the consolidation of the first parameter + the second parameter of your batchfile (test.bat):
For example, if your input is test c:\ user (with a space between c:\ and user), this batchfile will set rootdrive to "c:\user" (one string, no space between c:\ and user).
Now, let's say you have %homedrive%, and %homepath% (two environment variables), and you want to 'consolidate' them into one environment variable (%rootdrive%). This is like the opposite of the former example...
So, typing set at the prompt would give you something like homedrive=c:\
--- Test.bat --
rem Write the output of set to check.bat
rem Retrieve the homedrive setting (/i for no distinction between rem caps and lower-cases) in check.bat and write them to
rem home.bat. < is used to avoid the -------check.bat the FIND
rem command generates.
find /i "homedrive" <check.bat>home.bat
rem Do the same for homepath, add it to home.bat
find /i "homepath" <check.bat>>home.bat
Now we have a home.bat-file containing the following:
Now, we need those two values combined in one string "c:\user" and we need it to be set as the %rootdrive% variable.
And that is where I'm stuck . If you just can tell me whether I'm going in the right direction or not...
If yes, I'll try to work it out later...
If not, well... too bad
February 5th, 2003, 08:21 PM
Is it just me or does this still say the overall rating of this post is currently : even? anyway, awesome post on our old friend of computing, DOS, (but still Kickin ass!!)
February 5th, 2003, 11:13 PM
lol, Not any more....though I think Negative needs to make a DOS&CMD Unleashed- Revisited redo it since some things have changed since 2k and XP came to the scene...
With all the subtlety of an artillery barrage / Follow blindly, for the true path is sketchy at best. .:Bring OS X to x86!
Og ingen kan minnast dei linne drag i dronningas andlet den fagre dag Då landet her kvilte i heilag fred og alle hadde kjærleik å elske med.
February 10th, 2003, 07:18 PM
February 18th, 2003, 05:50 AM
i downloaded dosunleashed.txt and bat2exec.zip into mydocuments folder. each time that i try to open them they flash for about 1 second and then disappear. how can i keep these files open?