Why don't you create a share on a server and give everyone access to the share? That way the files are somewhere that can be backed up if necessary and you don't have to give everyone access to your PC. Thanks for all the replies. I will check what y'all suggested.
However, I don't think it is a permissions issue. I have a smaller similar script that used the same path, and executed with no issues as intended.
Now that I have IF statements, things have stopped working. Which leads me to believe it is an issue with my IF syntax. Any guidance would be appreciated. I'm not so sure I haven't really used an IF statement in a batch file in a while or even batch files at all lately really. I have a batch reference book at the house I could look it up in. I'm not sure if the snippet of code is exactly as it is in the batch file, but if it is then it sounds like it needs to be reformatted.
I am really thinking I have something just a bit off on the IF statements. Is there some stupid syntax error I have missed? If the snippet above is actually a direct copy of the code. I don't think it will work correctly. If you look at the first answer to the StackOverflow question they state that:. I think you would have to use a single GOTO command to jump to another section of the code where it can then run each command in the group individually.
To be honest I'm not sure though, my batch skills are a little rusty. It is not quite the same as a modern day full programming language. Try flipping it and make it. I'd also make a txt file if it exists to see if that is running.
Dustin may be right. In one I have that is similar, I have the If statement multiple times with 1 command in each. I did that for a reason. Got it to work. Strange how the placement of the 's on the same lines was the only thing causing problems. What a strange quirk! Below I have posted my working tested just a few moments ago code. Good to know my logic was correct, just not the actual placement of 's in the code itself. Thanks yall! Active 11 months ago. Viewed k times. Improve this question.
Jost 5, 8 8 gold badges 39 39 silver badges 67 67 bronze badges. A google search comes up with Testing if a Drive or Directory Exists. And this explains exactly how to do what you are asking for A search for "batch-file directory exists" here on SO found Windows Batch File Look for directory if not exist create then move file , which shows you how to see if a directory exists or not. There are posts here about creating a directory from a batch file as well.
Please do some basic research before posting new questions; chances are good the question has been asked here previously. Windows batch is a programming language, check if the file exists is a programming task.
Appears on topic. Should be closed as dupicate of How to test if a file is a directory in a batch script? Add a comment. Active Oldest Votes. For a file: if exist yourfilename echo Yes else echo No Replace yourfilename with the name of your file. Improve this answer. Community Bot 1 1 1 silver badge. The second part of your answer is incomplete. See the update at stackoverflow.
AlexanderGelbukh It works without the quotes. Of course, this limits you when it comes to having spaces in the directory path. Yes, without quotes it works. Show 1 more comment. I think the answer is here possibly duplicate : How to test if a file is a directory in a batch script? I think this is also specified in the referenced link. Still don't get it why I got downvoted which means "Not useful".
I added the reference to the question where the answers cover the required scenario. Not useful could be because it is not applicable to current machines, and your earlier answer didn't make any distinction.
0コメント