Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!srhqla!demott!kdq From: kdq@demott.COM (Kevin D. Quitt) Newsgroups: comp.sys.ibm.pc.misc Subject: Re: DOS Environment Variable Question Message-ID: <646@demott.COM> Date: 2 Oct 90 21:50:49 GMT References: <1990Oct1.191910.560@odetics.com> Reply-To: kdq@demott.COM (Kevin D. Quitt) Distribution: na Organization: DeMott Electronics Co., Van Nuys CA Lines: 24 In article <1990Oct1.191910.560@odetics.com> frank@odetics.com (Frank Merrow) writes: > >I wanted to create a MS-DOS environment variable at boot time off the form >set TODAY=yymmdd so that other *.BAT files can create backup files and >other such things. I looked threw the MS-C manual and found putevn() and >getenv(), but they seem to effect the PROGRAM's copy of the environment, while >I want to effect "THE" environment. > >Anyone got a good/easy way to do this? An easy cheat that doesn't require the use of undocumented system calls is to write "set today=yymmdd" to a file called "today.bat". Have your autoexec invoke your settoday program, then the today batch file. (Make sure you CALL TODAY, and don't just invoke it directly, unless it's the last thing your autoexec.bat is going to do). -- _ Kevin D. Quitt demott!kdq kdq@demott.com DeMott Electronics Co. 14707 Keswick St. Van Nuys, CA 91405-1266 VOICE (818) 988-4975 FAX (818) 997-1190 MODEM (818) 997-4496 PEP last 96.37% of all statistics are made up.