Windows Registry: What does #="Outlook64Bridge" mean? - windows

In this question the answer includes modifying the Registry with the following line:
#="Outlook64Bridge"
Does that mean that I need to add a value for the new subkey, with the Name of #, Type of REG_SZ and Data of Outlook64Bridge?
Does the # have any special meaning to the Registry? I ask this because the second part of the answer also has instructions for adding this to another (already existing?) key.

'#' is the "default" value. In RegEdit, it is the first value listed under the name "(Default)" in any key.

Related

Setting special characters in QSettings

I'm trying to edit a desktop.ini file using QSettings. I need to set a value on a section that contains { and } which I believe are special characters.
I am currently setting these value using the following code:
desk_ini.beginGroup("{F29F85E0-4FF9-1068-AB91-08002B27B3D9}");
desk_ini.setValue("Prop5", "TestTag");
desk_ini.endGroup();
Unexpectedly after executing the program, this is what is looks like in the INI file.
[%7BF29F85E0-4FF9-1068-AB91-08002B27B3D9%7D]
Prop5=TestTag1
After some reading, I found these: (Quoting from the QSettings Documentation)
The INI file format has severe restrictions on the syntax of a key. Qt works around this by using % as an escape character in keys.
It seems like QSettings is using % to escape {}
Now, I really need it to be "as is" for the desktop.ini to be read property.
To reiterate, my question: Is there a way to set special characters in QSettings without changing them?

Powershell remove all keys, dwords,... which contain a defined word

is there a way to remove all subkeys, and their subkeys, and their subkeys, ... from a defined path if the name/value contains a defined word?
$Path: "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider"
$Word: "Server1"
I want to remove all items under $path (include all subkeys, ...) which contains a defined $word.
But I don't get to the deepest levels of the keys
I just get on one layer down to like:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider\S-1-5-21-xxx\
But I want to all, including:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider\S-1-5-21-xxx\Printers\Connections
Looking forward to your help
regards, Michael

Certain characters make moveItemAtURL:toURL:error: crash. how do I avoid them?

First, I'm using Swift. Second this line works fine in my code:
let didIt = fileManager.moveItemAtURL(originalFilePath, toURL: newFilePath, error: nil)
...as long as there are no special characters in the newFilePath. if the newFilePath has a dollar sign or an ampersand ($, & ) in it, the line fails. My issue is that the newFilePath comes from a text field in a window where the user can type any old thing. How do I escape special characters, or encode them so they will pass the test and be included in the new filename?
thanks in advance for any pointers.
My issue is that the newFilePath comes from a text field in a window where the user can type any old thing.
Right there is your problem. Why are you not using an NSSavePanel for letting the user select a name under which to save a file?
If you insist on taking input from a text field, the docs for -URLByAppendingPathComponent: specifically say that the path component string should be "in its original form (not URL encoded)" (emphasis mine).
How did you originally create newFilePath, before appending the path component? For example, you should have used one of the methods with "[fF]ileURL" in the name.

Wildcard searching with Batch

Essentially I need to search for a word which can end and start with different things but always contains the same content in the middle.
i.e. 345345hello356
a0a0aphello553
I need to search through the registry for this key under:
HKCU\Software\[KeyBeingLookedFor]
So essentially, get the batch file to look through every key in HKCU\Sotware and if it finds it, spit out Key found via Echo.

Does the "SubstituteName" string in the PathBuffer of a REPARSE_DATA_BUFFER structure always start with the prefix "\??\", and if so, why?

I am trying to use Windows API functions compatible with Windows XP and up to find the target of a junction or symbolic link. I am using CreateFile to get a handle to the reparse point, then DeviceIoControl with the FSCTL_GET_REPARSE_POINT flag to read the reparse data into a REPARSE_DATA_BUFFER. Then, I use the offsets and lengths in the buffer to extract the SubstituteName and PrintName strings.
In Windows 8, extracting the PrintName works perfectly, giving me a normal path (ie c:\filename.ext), but in XP the PrintName section of the REPARSE_DATA_BUFFER seems to always have a length of 0, leaving me with an empty string.
Using the SubsituteName seems to work in both, but I always end up with a prefix of \??\ on the beginning of the file path (ie \??\c:\filename.ext). (as a side note, fsutil reparsepoint query shows the \??\ prefix as well).
I've read through much of the documentation on MSDN, but I can't find any explanation of this prefix. If the prefix is guaranteed to begin every SubstituteName, then I can just exclude the first four characters when I copy the file path from the buffer, but I'm not sure that this is the case. I would love to know if the "\??\" prefix appears in the SubstituteName for all Microsoft reparse points and why.
The Windows kernel has a "DOS Devices namespace" \DosDevices\ which is basically where anything you can open with CreateFile resides. (QueryDosDevice is a function which gives you all the members of that namespace.)
Because it's such a commonly used path, \??\ also redirects to that namespace. So, to the kernel, the path C:\Windows is invalid -- it should really be written as something like \??\C:\Windows. That's where this notation comes from.
The \??\ prefix means the path is not parsed. It is not guaranteed on every name, so you will have to look for the prefix on a per-name basis and skip it if present.
Update: I could not find any definitive documentation explaining exactly that \??\ actually represents, but here are some links that mention the \??\ prefix in action:
http://www.flexhex.com/docs/articles/hard-links.phtml
Note that szTarget string must contain the path prefixed with the "non-parsed" prefix "\??\", and terminated with the backslash character, for example "\??\C:\Some Dir\".
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/908b3927-1ee9-4e03-9922-b4fd49fc51a6
http://mjunction.googlecode.com/svn-history/r5/trunk/MJunction/MJunction/JunctionPoint.cs
This prefix indicates to NTFS that the path is to be treated as a non-interpreted path in the virtual file system.
Private Const NonInterpretedPathPrefix As String = "\??\"

Resources