PROBLEMCHYLD Posted April 11, 2013 Share Posted April 11, 2013 It seems all of the methods work under certain conditions. Windows 98 native COMMAND.COM didn't understand (GOTO :NEXT) but understood GOTO NEXT. WIN95CMD.EXE file understands both. So it seems certain flags/pipes/variables etc..,.. are recognized by both, but the WIN95CMD.EXE seems to recognize most if not all. Thanks guys, its working smoothly. Link to comment Share on other sites More sharing options...
Yzöwl Posted April 11, 2013 Share Posted April 11, 2013 Why could you not simply correct the first word after the equals symbol in each of the four cases I provided!I think that it may be you who is misunderstanding OR!You now seem to only want FILE.THREE to be deleted if both of the other two files do not exist.IF NOT EXIST "FILE.ONE" (SET _=BO)IF NOT EXIST "FILE.TWO" (SET _=%_%TH)IF %_%==BOTH DEL "FILE.THREE"So in summary:IF BOTH FILE.ONE AND FILE.TWO DO NOT EXISTuse the above exampleIF AT LEAST ONE OF FILE.ONE OR FILE.TWO DO NOT EXISTuse either of the two examples I provided in my original post Link to comment Share on other sites More sharing options...
gunsmokingman Posted April 11, 2013 Share Posted April 11, 2013 Yzöwl did you look at post 14 it was the VBS way of doing what PROBLEMCHYLD wanted done.If you read it and it really simple if the 2 files are not there then delete file 3, I am Dyslexic and could understand what PROBLEMCHYLD wanted.Yzöwl cool code Link to comment Share on other sites More sharing options...
tomasz86 Posted April 11, 2013 Share Posted April 11, 2013 (edited) What is the value of %WinDir%? Does it have spaces?The Windows folder can't have spaces so you don't need quotes (unless you set the variables manually to something else but it's not the case here). Microsoft themselves usually don't use quotes when pointing to %windir% / %systemroot% in their patches.I usually suggest hardcoding paths to save headaches, especially for core files in C:\Windows\System ( Win9x ) or C:\Windows\System32 ( WinXP+ ). Earlier NT and 2K might have been in \WinNT but unless running on an older one is a real possibility, avoid it.Newer Windows can also use WINNT, ex. when you upgraded your system from Windows 2000 to XP, later upgraded XP to Vista, and Vista to 7, etc. Edited April 11, 2013 by tomasz86 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now