fisher@sc2a.unige.ch (Markus Fischer) (11/10/90)
In article <ETXBJK.90Nov6132203@solsta.ericsson.se>, etxbjk@solsta.ericsson.se (Bjorn Karlsen TX/DKI) writes: > How can I change the "Hide"-flag from the DOS prompt? > > By using ATTRIB, I can change the "Archive"- and "Read Only"-flags, > but not the "Hide"-flag. > > The problem is that some users have [hidden] their AUTOEXEC.BAT and > CONFIG.SYS. And without bringing a program with me (Quick Disk, > PC-TOOLS etc.), I'm not able to access those files for editing. > Tricky, but not impossible. You need to find those commands of MS-DOS that override the hidden flag. You can't use `ren', `copy' or `del', but you can use `type' to look at any hidden file, or `chkdsk /v' to see the full directory, including hidden or system files and directories. Thus the sequence: C> chkdsk /v .. Ctrl-Break C> type autoexec.bat > autoexec.new shows you the root directory and creates a copy of the hidden autoexec.bat. This is nice, but you can't replace the autoexec.bat. In fact, you still need an external command to change the hidden flag. But if the user has changed this flag, the tool must be present somewhere on his disk. You don't want to look for it? Ok, so here is another solution (sorry for the long intro., I couldn't resist to make you impatient...): C> echo e | edlin autoexec.bat C> echo e | edlin autoexec.bat C> del autoexec.bak Yes, this is the (only?) way to remove the hidden flag in plain DOS... The first call to `edlin' leaves a *hidden* autoexec.bak, the second call overwrites it with a non-hidden autoexec.bak, which you can then delete. Glad I could help, Markus Fischer, Dpt of Anthropology, Geneva.