How to set directory-property comments - powershell

I'm trying to find a way to set comments with powershell for a directory.
How can I set for a folder comments (like contains contact files)?
Thanks for infos

This is a quite interesting question so i quickly did a bit of research. It is not as trivial as one would hope. In fact at least on W10 its basically impossible to do it via UI but i found a way to do it with Powershell:
First you have to make the Folder a system folder (somehow comments are only shown on system folders on my machine, got to test on yours yourself):
attrib +s <Folderpath>
Not sure if we can do it with a cmdlet (probably but no time to research right now).
Then you have to create a "Desktop.ini" file inside the folder like so:
"[.ShellClassInfo]","Infotip=YOUR COMMENT HERE"|Out-File <Folderpath>\Desktop.ini
and thats basically it :)

Related

How would I be able to make this possible with Powershell?

Basically what I want to do is locate a shared folder on the server (I'll be running this script from the domain controller), unshare it (so I make sure no user is still using files from there, to avoid issues), and then backup all the files from that folder into a .zip/.rar, then share the folder again. I been looking into how to automate this using powershell (I dont have much experience with it), I found this script (https://github.com/Seidlm/PowerShell-Backup-Script/blob/master/BackupScript.ps1) that im planning to modify, but I still not know how to unshare and share a folder with powershell or how to make it so that the script is automatically executed for example every day at 1:00 am or something like that, how would I be able to this? I dont want you guys to do my homework, if you could just point me in the right direction or link some documentation I would apreciate it.

How to expand VScode directories

I know this has been answered somewhere before, but for the life of me I cannot figure out how to properly Google this query. I got a new computer and I've mostly setup my Visual Studio Code environment, but I have never liked the shorthand directory structure if defaults to. I want to change my directories to be full dropdowns and not a one-line somedirectory/subdirectory/subdirectory/something.js
Apparently there is some fancy word for it but I have no idea what that word is and it's making my searching surprisingly difficult.
So, what setting do I need to change in VScode to make all of my directories follow the format that Collection has in the example below and not like lessons/flashcards?
Thanks!
TLDR; I want every directory to be a full dropdown. None of this lessons/flashcards nonsense.
To Achieve this go to your vs code settings and search Compact Folders. It will be checked by default. Uncheck that and it will work.

Powershell: informations about last Windows graphical copy

This is my first post in stackoverflow, so hi to everybody!
I have a strange question. I'm searching for a way to get informations about the last Windows copy with PowerShell (version 3.0). For example, I copy (graphical way, not throw Powershell) one file from one destination to another and than I want to get information about this copy with Powershell (I need only the last copy operation). Exist a way to have this information?
Thanks a lot and sorry for my bad english!
Federico
This question fits better on SuperUser as you would need to enable file auditing, have a look here:
https://superuser.com/questions/521945/file-auditing-in-windows

Thunderbird removes any attempt to make an extension

I might be a complete idiot, so please bear with me if I am.
I've been attempting to create an extension for Thunderbird.
I quickly googled for an official documentation and followed it as closely as I could. This way, I ended up with a simple result to test, which would, according to the documentation, work.
So I opened up Thunderbird, nothing.
I closed it again and went to see what I did wrong. However, Thunderbird had completely removed the folder I had.
I did this a few times more with the same result.
This is what my folder setup looked like:
%APPDATA%/Thunderbird/Profiles/[profile name]/extensions/
foobar#foo.bar/
install.rdf
chrome.manifest
chrome/
content/
foobar.xul
foobar.js
locale/
defaults/
preferences/
The contents of these files were, at my last attempt, literally copy/pasted from the documentation, only with altered filenames(both in code and in actual files), extension ID(both in code and the folder name), and maximum version tag.
What exactly am I missing here?
I absolutely agree with using proxy files for addon development. But if you followed the guide mentioned by Jonathan Protzenko, your structure would look more like this:
%APPDATA%\Thunderbird\profiles\[profile name]\extensions\
foobar#foo.bar
SomeDrive:\path\to\some\place\
foobar_dev_directory\
install.rdf
...
chrome\
i.e, the development directory is not located inside your profile. Instead, consider the proxy file
%APPDATA%\Thunderbird\profiles\[profile name]\extensions\foobar#foo.bar
SomeDrive:\path\to\some\place\foobar_dev_directory\
You must only enter the second line, and never forget the trailing \ as mentioned here (3, Note).
Also you should uninstall the addon (if you had one with the same id created and installed before). When you start tb the first time thereafter, you will be asked to allow exernal addons to be installed or something similar.
I got things working this way, hope this helps.
A second guess might be the following: you're obviously working on windows. Are you viewing files always with extension in windows explorer? If not or not sure, check the following:
In Windows Explorer under Organize \ Folder Options \ View deactivate Hide extensions for known file types.
Further, try using a proxy file named differently, especially without the top-level domain. I suspect this could be misinterpreted by windows as an extension. You should call your proxy file thus foobar#foobar.

Writing a macro

I'm mostly new to programming and so I have come here for some help.
Recently, at work, the program that we have used for years has drastically changed and all of our old file types are no longer supported. This has left us completely out in the cold as to how we can access our old files without using the older software. With that being said, here is my problem with macros that I'm in need of help:
I need to be able to open a file in a specific program, copy all the text in the file, paste the text into a new notepad document and then save the notepad file with file's original name as a simple text document. I need to do this to an entire folder (and eventually folders within a folder but that can wait for now)
If I need to clarify anything let me know. Like I said, I'm new to this stuff and I'd appreciate any tips you guys could give me.
Since you mention Notepad, I'll assume that you are working in Windows. In that case, you're probably best off writing it in PowerScript. I don't have the skills for that, but if you add "Windows" and "PowerScript" to the tags, you may have a better chance of find someone sho does. (You may want to try this question over at SuperUser)