[H-GEN] File listing

hphillips at 4ward.com.au hphillips at 4ward.com.au
Tue Sep 24 08:45:12 EDT 2002


[ Humbug *General* list - semi-serious discussions about Humbug and     ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]

I am trying to create a batch file that Windows machines will run when they login to a
samba server. I have update files stored on the server and they need to be
copied to the WS if they don't already exist.

The files are in a 8.3 format and the update dir contains more than 1 file. I am running
a daily script that does the following:
1. An 'ls -1' on the update dir into a file (list.txt).
2. Use awk and that file (list.txt) to create a batch file.
3. In the batch file I use labels based on the update file name.

I can't get Windows to go to that label if it uses a dot in the name. It gives an error
message 'Label not found'. I did a search of google and have found that if you use
a dot in the goto command it will use the first 8 characters and first three after the dot.

eg 'goto 123456789abcde.zyxw098' will make it jump to the label ':12345678zyx'

My labels are in the format ':12345678.xxx' using 'goto 12345678.xxx' gives the 
label not found error message because there is no label ':12345678xxx'

I could get it to work if I could do 1 of several things.
1. Rewrite Windows so that it will 'goto' a label that has a dot.
2. While doing the 'ls -1' get it to output only the first 8 characters
(the extension is always the same)
3. Manipulate the file (list.txt) so that each line has only the first 8 characters on it.

Doing 1 will be a bigger task than I am willing to take on, can anyone help with number
2 or 3? Or maybe suggest something I haven't thought of.

Regards,
Harry

PS. I know I could just use 'copy *.* c:\updatedir /y >nul' to copy every file everytime
anyone logged in but I don't like the amount of network traffic that will generate
and I also want to be a bit cleverer than that.



--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.  See http://www.humbug.org.au/



More information about the General mailing list