Discussion Locked

batch files

0 helpful
12 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have batch files for different departments created with a std.bacth for allusers. All the the batch files are set up to call all users first then followed by specific net use commands for each department. the batch files reside in the scripts folder on the nt server.
On win2k machines the batch files run ok.. However,I get an error message on the called batch files on win95/98. The interesting thing is when these same batch files are written and executed locally they seem to work. I can,t figure out why it won't run usinglogon script from
the NT server but is executed correctly on the win2k workstations. I could use some detailed assistance here. thanks Pete

12 replies

by a.jongsma

[QUOTE]I get an error message on the called batch files on win95/98.[/QUOTE]
Could you also tell which error and, if possible, the part of the batch where the error is generated?

It has, most likely, to do with some variables you have set but without knowing the error or the contents of the batch it's rather difficult to pinpoint

by mike jones

Two issues that I could think that would cause this.

1. Permissions. Win2k handles permissions better than 98. Set the permissions on the batch files so that everyone has read access.

2. There are difference to the command line switches in dos on 98 over win2k. For example the NET USE commands are slightly different.

I assume that you are using for example NET USE \\server\%username% commands in your batch files.

I think this should be %%username%% from a login script rather than %username%. I think win2k will handle this better, but win98 may fail.

Just a few things for you to look at. But as mentioned before, if you could tell us what line the script is failing at, or even if the script is starting.

by isoro

this how i set up user.bat:net use g: \\server\shared folder.
qc.bat : line 1 is user.bat,line 2 is net use z: \\server\folder2,line 3 is exit.
logon script name=qc.bat
On win2k it completed sucessfully. However, on win 98/95 line 1 completed successfully and an error message "bad command or file name came up for line 2.

by /dev/null

This could be one or both of the following.

On line 2 you are mapping the Z letter.

A Win9x client automatically maps Z: to the domain controller that's authenticating it when it runs a domain login script. It does this because it can't properly run a login script via a unc path. NT and higher clients don't have a problem with this. See the following Microsoft KB: http://support.microsoft.com/?kbid=268882 It contains a workaround, but I don't think it'll help in your situation. If this is the problem you're encountering you might have to use a different drive letter for the 9x clients.

Second possiblity:
http://support.microsoft.com/?kbid=221762 - Error Message Using the CALL Command in Windows NT Logon Script This article seems to apply only to Win95 clients though. It explains:
********
To work around this behavior, you can modify the logon script so that it does not use the call command. For example, assume that you want to use the following sample script:
echoon
call \\server1\share1\script1.bat

Instead, use the following method:
echo on
net use x: \\server1\share1
x:\script1.bat
net use x:/d
***********

Good luck!

by churdoo

Well "bad command or file name" simply means that the command processor cannot find the command that you're requesting, i.e. net.exe
It's possible, that the the time of invocation, c:\windows (default location of net.exe on 9X clients) is not in the PATH, however once your login is complete, the path is set and that's why you can execute the batch files locally/manually.
As a test, you can modify line 2 of your sample batch file to read 'c:\windows\net use z: \\servername\sharename' and test that on a Win9X client (assuming that the net command is located in c:\windows).
If that works in the test, then you just have to figure out how to specify the location of the net.exe command on your 9x clients without dorking up the execution on your 2K clients.
Looks like you're proficient enough at batch files to figure that part out; if not, post or email.
--c

by vh_s

The Win95 or Win98 works quite differently than W2K workstation.

I think you miss an important thing in your CONFIG.SYS file. Add this line to your CONFIG.SYS file.

LASTDRIVE=Z

Using the above configuration, Windows will preserve drive letters in their configuration.

Try it out, and let me know.

This discussion is closed to new replies.