I tried following code:
if exist "\\%1\c$\users\Public\" (
set sysos=Windows 7
) else (
set sysos=Windows XP
)
But when they can't find \\computername\c$
it takes more than 20 seconds for a time out. How can I create a shorter timeout in the code?