Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

If Exist ?  WinNT vs Win2K

Posted on 2004-04-16
4
Medium Priority
?
150 Views
Last Modified: 2010-04-13
Good Morning,
I'd like to use the "If Exist" statement in the logon script to copy some files to my client PC's.  I have a mix of NT4 and 2K workstations, and the different OS's need different files copied to them.  Are there files that exist in NT but not in 2K, and files that exist in 2K but not in NT?
I was thinking about a batch file that looks like this:
>>> If exist "NTspecificFile.abc" go to NT
>>> If exist "2KspecificFile.abc" go to 2K
>>> NT
>>> copy command
>>> goto END
>>> 2K
>>> copy command
>>> goto END
>>> END

I appreciate your assistance.
Thank you in advance,
Dougget
0
Comment
Question by:Dougget
4 Comments
 
LVL 20

Accepted Solution

by:
Dufo G. Belski earned 500 total points
ID: 10841639
Check the solution provided by the expert named billious here:

http://www.experts-exchange.com/Operating_Systems/MSDOS/Q_20665341.html

He parses the results of the "ver" command to identify the OS.
0
 

Assisted Solution

by:jzanette
jzanette earned 500 total points
ID: 10843677
A more straightforward and self-documenting solution would be to use the FREE Advance NT/2K/XP/K3 Command Library, which provides commands like:

   %.ifNT% (
      [NT Commands Here]
   ELSE
      [2000 or above commands here]
   )


*******
For more information and color-keyed examples:

   (http://TheSystemGuard.com/MtCmds/IfCondition/ifNT.htm)
   (http://ntlib.com)


     
0
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 12292005
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:
Split between asyscokid and jzanette

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Leew
EE Cleanup Volunteer
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month12 days, 19 hours left to enroll

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question