• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

OT-but for a cruncher.....DOS Batch file help

MoFunk

Diamond Member
Is there a way in a batch file to uncheck the read only for all files? I have a batch I am using to copy the contents of a cd which are all .tiff files to a directory on a PC, but then I have to select them all and uncheck the read only. So hopefully there is a command for that so I can have the batch file do it for me. Thanks.
 
Polo's one also removes Hidden and System attributes from the files 🙂 I'm not sure if his will do subdirectories tho 🙂



Confused
 
That rocks! Thanks both of you. And since I see you guys know DOS, here is another maybe you can help with. I need to be able to print the contents of a directory. I found a way to make a print directory show up when I right click a folder and it does what I need, but I want to add it to my batch file. Here is what I am doing

I am copying .tiff files from a CD that I am sent every day, after the copy the attributes get changed with a batch file. Then I have to bring up that folder, rt click and print the directory listing. I then make some modifications to the .tiff files and run another batch file that moves them to another drive on the network and then calls a program that sorts them into folders using a julian date that is in the name of the .tiff.

What I would like to do is in the first batch file after the attributes are change it will them print out the directory listing for me that will give me the number of files and their complete name. Is this possible? Thanks.
 
dir *.* /s > filelist.txt

That will put the contents of the directory, and sub directories (omit /s if you don't want subdirectories) into a text file called filelist.txt

Then you can open up the text file and print it out 🙂


Garry
 
What Confused said. 🙂

you can also use

DIR *.* /s|SORT>filelst.txt
PRINT filelst.txt

You should be able to use DIR *.* /s|SORT>prn or DIR *.* /s|SORT>lpt1

SORT will sort the file list, and >prn or >lpt1 should send the output directly to the printer. 🙂
 
Originally posted by: RaySun2Be
It's funny, I have a hard time remembering what I had for lunch yesterday, but I can quickly recall DOS commands. :Q

I can still remember a good portion of the high ASCII characters (I still had the page I ripped out of my DOS 5 book pinned up until last time I moved), but I don't remember what I did last weekend. The vodka and beer may have something to do with it, but that's a whole nother story. 🙂

 
Originally posted by: RaySun2Be
It's funny, I have a hard time remembering what I had for lunch yesterday, but I can quickly recall DOS commands. :Q

I sometimes have trouble remembering what i was doing just before I left the room to go to the bathroom, then come back and if it's not totally obvious what I was doing (ie i don't trip over it and almost break my neck) then I come on AT and browse for a while before I suddenly realise "Oh crap, yeah, that's what I was doing!" 😱
 
OK - since this is turning into the DOS batch string, I will ask my question.

I used 98SE to format and make bootable several small hard drives for seti crunchers. I have loaded freesco linux onto them, which is started by calling a file named router.bat

How do I setup my autoexec.bat and config.sys to go ahead and load dos, but then give me 5-10 seconds to exit out to dos, instead of starting/calling the router.bat file right away?

These machines are being setup to restart after a power failure, so I want them to go right into freesco after a 5-10 second wait.

I am slowly but surely converting my M$ machines to freesco for crunching seti.
Now if I could only find a mini-distro that ran WINE so I could gain another 3-5% per machine.

Thanks...Carl

 
I vaguely remember doing something like that for my old computer with a QBasic program, so that if I leave it, it would boot into Windows 3.0 after a few seconds, but if I pressed a button, then it would boot to DOS for my games.

Not that I can remember much, if any of it, but that might be something to look into 🙂

If you want (and no one else has thought of something), then I'll have a look tomorrow and see if I can make something up for you (and remember half the QBasic commands 😱) 🙂



Garry
 
I don't think there is a way to control config.sys, but you can use the sleep.exe (comes on resource toolkits for 98,NT4,2K) in the autoexec.bat to pause for x number of seconds before continuing.

If you don't have access to a resource kit, let me know and I can email it to you.

I also found this script you can use (it is setup for minutes) in the BAT file:

@echo off

REM ** Delay is set to 5 minutes
set delay=5

set testtime=%time%

if "%testtime:~0,1%"==" " set testtime=0%testtime:~1%

echo Start time: %testtime:~0,8%

set /A hh=1%testtime:~0,2% - 100
set /A mm=1%testtime:~3,2% + %delay% - 100
set ss=%testtime:~6,2%

if /I not %mm% GEQ 60 goto NORMALIZE

set /A hh=hh+1

if /I %hh% GTR 23 set hh=0

set /A mm=mm%60

:NORMALIZE

if /I %hh% LSS 10 set hh=0%hh%
if /I %mm% LSS 10 set mm=0%mm%

echo Waiting for: %hh%:%mm%:%ss%

:TIMETEST

set testtime=%time%
if "%testtime:~0,1%"==" " set testtime=0%testtime:~1%

if not %testtime:~0,2%==%hh% goto TIMETEST
if not %testtime:~3,2%==%mm% goto TIMETEST

:SECTEST

if /I 1%time:~6,2% LSS 1%ss% goto SECTEST

echo %delay% minute(s) has gone by

set testtime=%time%
if "%testtime:~0,1%"==" " set testtime=0%testtime:~1%

echo End time: %testtime%

set testtime=
set delay=
set hh=
set mm=
set ss=
 
Ray, that's it...

sleep x


The other stuff I could do from a cmd window in XP to try, but that wouldn't work! 😉

I would try adding sleep x, and see if that helps 🙂

If not, then my offer to take a look at doing something in QBasic still stands (unless, of course, someone else can come up with a solution 🙂)


Confused
 
Cakin, I'm not 100% sure I'm following you on this:

How do I setup my autoexec.bat and config.sys to go ahead and load dos, but then give me 5-10 seconds to exit out to dos, instead of starting/calling the router.bat file right away?

If I'm understanding you, you want it to work automatically if power goes off, but have the ability to run something different if not. If so, the DOS Menu commands in the config.sys (and can also be configured to work in autoexec.bat) can do that. I found a website that gives a great description of it here:
http://home7.inet.tele.dk/batfiles/msdos7/

Just scroll down and click on the "Config Menus" item on the left. It won't let me directly link to the page because of the frames.

Basically that will allow you to build a startup menu similar to the one used to get into safe mode on 95/98. It let's you have a timer on how long before it picks the default, etc etc.

May not be where you're trying to go, but hope that helps 🙂
 
Since you guys rule and all, I think I will ask my next question here. Is there a way to print a .tif image from DOS? We get ER dictation from a specific hospital on a CD everyday, I then have a batch file to copy the cd to a folder and change it's attributes (thanks guys). Then what they are having to do it open each file in a viewer and print. I have to print from a batch file but I just get random characters. I have tried using the right click and print method but it will only do the first page. Am I out of luck? Or do one of the DC guru's have a solution? Thanks guys.
 
If your are doing the print from Windows Command prompt, try to use Paint Shop Pro..

It have a autoviewer and (i believe) print batch controlled program..

Really nice to use for converting lots of pics and stuff..
 
Originally posted by: soni
If your are doing the print from Windows Command prompt, try to use Paint Shop Pro..

It have a autoviewer and (i believe) print batch controlled program..

Really nice to use for converting lots of pics and stuff..

I did figure out that I could use acrobat to do this since it is already installed. So this is a solution for now. What I would really love is to be able to write something into the batch file they run that will send these things to the printer automatically.
 
Back
Top