XP adds quotes where WIN2K does not ?

  • Thread starter Thread starter Steven Adams
  • Start date Start date
S

Steven Adams

We have a logon script which calls another script which in turn calls a
third script.

A bit messy but that's just the way it is.

Under WIN2K there are no issues and all runs fine but from XP when %0 is
used to reference the source location the initial calling script is
surrounded with quotes but the rest of the path is left as normal.
This causes the path to be invalid ?

Maybe an example would help to explain:
the line in the script is:

If "%instsms%"=="YES" CALL %0\..\SMSINSTA_test.BAT


on WIN2K the command resolves to:

\\SERVER1\NETLOGON\mis_test.bat\..\CommonCCC_test.Bat\..\SMSINSTA_test.BAT\.
..\SMSBOOT1.EXE -S
\\SERVER1\NETLOGON\mis_test.bat\..\CommonCCC_test.Bat\..\SMSINSTA_test.BAT -
N -WINDIR=C:\WINNT

on XP the command resolves to:

M:\>"\\SERVER1\NETLOGON\mis_test.bat"\..\CommonCCC_test.Bat\..\SMSINSTA_test
..BAT\..\SMSBOOT1.EXE -S
"\\SERVER1\NETLOGON\mis_test.bat"\..\CommonCCC_test.Bat\..\SMSINSTA_test.BAT
-N -WINDIR=C:\WINDOWS

as you can see the XP version has extra quotes.

Any ideas ?
 
Just found an article on technet that explains it:

KB318689

Just a case of know what keyword to search for :-(

Steven Adams said:
We have a logon script which calls another script which in turn calls a
third script.

A bit messy but that's just the way it is.

Under WIN2K there are no issues and all runs fine but from XP when %0 is
used to reference the source location the initial calling script is
surrounded with quotes but the rest of the path is left as normal.
This causes the path to be invalid ?

Maybe an example would help to explain:
the line in the script is:

If "%instsms%"=="YES" CALL %0\..\SMSINSTA_test.BAT


on WIN2K the command resolves to:

\\SERVER1\NETLOGON\mis_test.bat\..\CommonCCC_test.Bat\..\SMSINSTA_test.BAT\.
.\SMSBOOT1.EXE -S
\\SERVER1\NETLOGON\mis_test.bat\..\CommonCCC_test.Bat\..\SMSINSTA_test.BAT -
 
Glad you found it, as I had forgotten the reference. We just wrestled with
that one a few months ago, along with a few minor misunderstandings about
how kixtart runs. I sure got a shock to find out there were issues like that
when running from the logon script.

/Al

Steven Adams said:
Just found an article on technet that explains it:

KB318689

Just a case of know what keyword to search for :-(


\\SERVER1\NETLOGON\mis_test.bat\..\CommonCCC_test.Bat\..\SMSINSTA_test.BAT\.
\\SERVER1\NETLOGON\mis_test.bat\..\CommonCCC_test.Bat\..\SMSINSTA_test.BAT -
 
In said:
Just found an article on technet that explains it:

KB318689

Just a case of know what keyword to search for :-(

Have not yet seen it, but thanks for calling attention and supplying
the KBA for it!
 
Steven Adams said:
Just found an article on technet that explains it:

KB318689

Just a case of know what keyword to search for :-(

Hi Steven,

Thanks for the reference!

However, I would point out a potential "gotcha" with the "ver | find" batch
file method of determining the running OS. If the client's PATH is messed
up and the shell can't locate find.exe, this will be, shall we say, a bit
of a problem. I recommend using an OS detection tool such as my own
osver.exe to do the OS detection instead.

http://home.comcast.net/~stewartb/wast.html

Regards,

Bill
 
Steven Adams said:
We have a logon script which calls another script which in turn calls a
third script.

A bit messy but that's just the way it is.

Under WIN2K there are no issues and all runs fine but from XP when %0 is
used to reference the source location the initial calling script is
surrounded with quotes but the rest of the path is left as normal.
This causes the path to be invalid ?

Maybe an example would help to explain:
the line in the script is:
<snip>

Besides these differences are annoying,
wouldn't this solve your problem without having to check the os version?

If "%instsms%"=="YES" CALL "%~0\..\SMSINSTA_test.BAT"

HTH
 
Back
Top