Novell is now a part of Micro Focus

Gotcha when Creating Login Script Batch Files

Novell Cool Solutions: Feature
By Jarrod

Digg This - Slashdot This

Posted: 6 Jun 2003

I created a batch file that would take the computer name, search the drive for programs and then append the results to a txt file. It would also make a second text file with the name of the computer (computername.txt). I was doing this all through a Login Script. All of this was working fine on Windows 9x, but could not get it to work on XP. (The only thing that was not working was creating the text file with the computer name. It would only take 8 characters of the computer name (computer.txt) and create the file.)

At first I thought this was part of DOS's limitations. However, if I ran this batch file manually it would create the text file with the full computer name. It made no sense that it would work manually but not in the login script since both ways were running the same login script.

Here's what I did to resolve it. I put the VER Command in the batch file. I found when I ran it in the Login Script it was running MS-Dos version 5.0. When I ran it manually it was running MS-Dos version 5.1. So I thought back to how I created the batch file and I remembered I created it on Windows 98. So I created a new batch file on XP. I then copied and pasted everything from the old batch file into the new one. Ran it in the login script again and it was now running MS-Dos 5.1. It was also doing everything I wanted it to do.

So my heads up to everyone is watch out on how you create batch files.

Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions.

© Copyright Micro Focus or one of its affiliates