Question

I am a college student taking an INTRODUCTORY Windows 10 Operating System SCRIPTING course and need...

I am a college student taking an INTRODUCTORY Windows 10 Operating System SCRIPTING course and need some help with this script I created.

I need to have the script confirm that the file exists before the batch file hides the file.

If the file doesn't exist, the attrib command should not be executed.

How do I do this? The batch file accepts unlimited file names and I think I could use IF EXIST but not sure how to write the code.

Thanks.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Yaa, you guessed it right

the syntax is: if exist <filename or path> <action>

to hide just do if exist <filename/path> attrib +h <filename/path>

+h is used for hiding

Hope you like the answer

Please comment for any doubts

Add a comment
Know the answer?
Add Answer to:
I am a college student taking an INTRODUCTORY Windows 10 Operating System SCRIPTING course and need...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT