scripts....what am I missing?

YeOldeStonecat

[H]F Junkie
Joined
Jul 19, 2004
Messages
11,330
First one...

Echo off
Ifmember "terminalserverusers" goto map
:map
echo off
del t:\temp\*.*
net use /delete t:
REM Use Subst to map s to the /sun directory
subst s: c:\sun
net use t: \\%computername%\temp\%username%
md t:\temp

But I get a Windows Script Host error upon logon...
Line:2
Char:31
Error: Expected end of statement
Code:800a0401

Originally it was..,below, but I got some similar error

Echo off
If member==terminalserverusers goto map
:map
echo off
del t:\temp\*.*
net use /delete t:
REM Use Subst to map s to the /sun directory
subst s: c:\sun
net use t: \\%computername%\temp\%username%
md t:\temp

Next script giving me an error

subst t: c:\users\%username%
net use s: \\terminal\sun

But I get another windows script host error upon logon

Line:1
Char:12
Error:Expected statement
Code:800a0400

Now...both of these scripts are being pushed out via GPO from SBS03r2. The machine they are intended to run on is a new terminal server, running 2008r2. I did a GPO with loopback, user config, logon...shoved those two VBS scripts there.

I'm not a scripted, I'm a fan of old school logon bats. But I'm following the scripts that the software company gave in their Citrix/terminal server guide for installing their software on a terinal server.

Servers name is "terminal"....original huh? :p
 
I may not be much help, but I noticed a couple of things.

I think you need to use the line "@echo off" otherwise "echo off" is telling it to echo back the word 'off'.

Also, when using goto, I think you need to add an :end section, or specify an exit, because if the user is not "Ifmember "terminalserverusers" goto map" then it's going to continue to the next line and run through the :map section anyway, simply add :end to the end of the script, and after "Ifmember "terminalserverusers" goto map", add a goto end
 
You should really look for a group based vb script, they work much better
 
Back
Top