dwsykes
(Fresh Scripter)
2018-04-18 10:09 PM
How does IF EXIST ("file or folder name") work?

I have been asked what protocols/process is used when IF EXIST is used in our login script... Unfortunately I have no idea. I know it is closely related to the IF EXIST dos command, but I am unable to find any code or examples of how it truly operates.

Can anyone help me out with an example of how it actually works?


Thanks!


AllenAdministrator
(KiX Supporter)
2018-04-19 01:25 AM
Re: How does IF EXIST ("file or folder name") work?

Search the board for "if exist(" , make sure to include the quotes.

dwsykes
(Fresh Scripter)
2018-04-19 02:20 PM
Re: How does IF EXIST ("file or folder name") work?

I did that, but after reading through all the posts... I did not see a response that explains the process. I know how to use the function, but I want to know what the code behind the function is doing. In other words, does it use a simple search and determine if the file/directory given is in the list and return 0 or 1 based on if the file/directory was in that list?

The reason for all of this is we used to have a login script (developed before I started) that used ICMP (which was allowed through Cisco ISE)... they don't seem to like the IF EXIST().... don't know why.