2

Normaly you can save a file and afterwards manually set the file attribute to "read only".

Now I'm looking to merge both subtasks into one. Ideally the Window's "Save As"-Dialog would give me on a Checkbox-Option "save as read only". At least this would work, as long as the software doesn't implement it's own "Save-As"-Dialog. Is there way to get this done? Using a tool, programming this myself, etc.?

Any help is greatly appreciated! The solution has to work for Windows 7.

Cheers, Albin

steven80
  • 47
  • 1
  • 10
Albin
  • 9,307
  • 11
  • 50
  • 89
  • Short answer: no. It may be possible to work with rights that if you place a file in a specific folder, it cannot be written to a second time (enable write, deny modify) but that makes it so for every file in that folder, and save won't work anymore either. – LPChip Aug 13 '17 at 18:59
  • @LPChip: thanks, at least a work around. Right now the workorund is to save the file twice: once in the original folder and once in a subfolder with "the limited rights". It's a little easier this way but still not perfect. In regards to your "no"? Do you mean that *you* don't know a tool or "easy setting" that does that or that it's not possible to program such a tool at all? If the latter please elaborate... PS. I can't take away "my own" right to change the files in a specific folder, but I can add a deny-rule, took me a while to figure this out - just in case s.o. wants to try it. – Albin Aug 14 '17 at 14:18
  • No in the sense of: this is not possible with windows. You cannot somehow make a save-as become auto read only after the save. Windows simply doesn't work that way. Some fileformats do allow this, but then you get specific to that fileformat. They're called templates and some programs support them. If you save a file as a template then opening that template will treat it as a new document. – LPChip Aug 14 '17 at 14:48
  • @LPChip: thanks again. Saving as a template is a good idea as well. Although I dont agree on "windows doesnt work that way". In principle (manually) it is possible to save a file and afterwards to set the "read only"-attribute while the file still hasn't been closed. It's just a matter of automating it and adding it as an option to the standard windows "Save-As"-Dialogue (which most programs use anyway). – Albin Aug 14 '17 at 21:27

1 Answers1

0

As a workaround, I made a batch script which I can access from file explorer that sets the file to read-only. See here.

Albin
  • 9,307
  • 11
  • 50
  • 89
  • @PimpJuiceIT to prevent redundant code at least while the other question is still in progress. – Albin Oct 21 '19 at 16:05
  • @PimpJuiceIT I don't want to change the code in two places while it's still in development (just curious which of the "nono"-reasons apply in this case?) – Albin Oct 21 '19 at 16:09
  • I was just saying for whatever code you says works for this question that you asked, post it. Otherwise, I'm just relaying what I've been told. If there are exceptions to this general rule, then I'm not familiar with those. I'm telling you what others have told me which seems to apply here in this case. If I'm wrong, then I apologize but someone will need to teach me something if that's the case. – Vomit IT - Chunky Mess Style Oct 21 '19 at 16:13
  • And by the way, this question popped up in a review queue and this is why I left the comment. I did not just go looking for this, the system flagged it because it met the criteria I suppose with the way the review process works. – Vomit IT - Chunky Mess Style Oct 21 '19 at 16:14
  • 1
    @PimpJuiceIT, no worrys thanks for the notification, I will c&p the code from the other question as soon as it's ready. – Albin Oct 21 '19 at 16:15