How can I programmatically add website to compatibility list internet explorer 11? - vb.net

I've tried adding registry entries at:
Hive: HKEY_CURRENT_USER
Key Path: Software\Policies\Microsoft\Internet Explorer\BrowserEmulation\PolicyList\
Value name: sub.companyname.com
Value data: sub.companyname.com
However in Internet Explorer 11 this method does not work as it seems the list has moved.
My.Computer.Registry.SetValue("Software\Policies\Microsoft\Internet Explorer\BrowserEmulation\PolicyList", "sub.companyname.com", "sub.companyname.com")

I had the same problem, but creating the registry key you mention works for me.
Have you tried creating the registry key by hand?
If you are running 32 bit IE 11, you must create the registry key in 32 bit registry hive, if you are running 64 bit IE 11 you bust create the registry key in 64 bit registry hive.
IE 11 32 bit on:
Win 32 bit -> HKEY_CURRENT_USER\Software\Policies...
Win 64 bit -> HKEY_CURRENT_USER\Wow6432Node\Software\Policies...
IE 11 64 bit on:
Win 32 bit -> Can't install IE 64 bit
Win 64 bit -> HKEY_CURRENT_USER\Software\Policies...
Remember:
If you have IE open when you create the registry key, you need to restart it.
The new domain allowed to use compatibility mode won't be displayed in compatibility view settings list.

It appears that under Windows 8.1 Enterprise/IE11 the entry is a binary one - this is where I see the entries added under Tools/compatibility View Settings in the registry on my system:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\BrowserEmulation\ClearableListData
Look for a Binary value called UserFilter - it's a bit hard to read when you look into it but you can tell it holds your entries.
We have several sites we'll need to add to the list so most likely will export the list from a "master" computer then push it through Group Policy Preferences at least once for initial settings. Unsure how we'll script additional entries at this point so that when users add their "personal" settings we don't overwrite the value but append to it but one thing at a time I guess.

W7 – IE11
Hive: HKEY_CURRENT_USER
Key Path: Software\Policies\Microsoft\Internet Explorer\BrowserEmulation\DisableSiteListEditing
Right Click on DisableSiteListEditing
Modify
Change Value Data from 1 to 0

Related

File create time doesn't change even after it is deleted

I am using the following code:
from datetime import datetime
import time, pandas as pd, os, pickle
df = pd.DataFrame(np.arange(1,200))
fn = r'C:\z1.p'
pickle.dump(df, open(fn, 'wb'))
print(datetime.fromtimestamp(os.stat(fn).st_ctime))
os.remove(fn)
time.sleep(5)
pickle.dump(df, open(fn, 'wb'))
print(datetime.fromtimestamp(os.stat(fn).st_ctime))
But I get the same create time from both print statements as:
2022-03-16 08:43:30.885011
2022-03-16 08:43:30.885011
How do I make sure that new time gets printed for second print statement?
This is a Windows feature, called "file system tunnelling".
The apocryphal history of file system tunnelling
One of the file system features you may find yourself surprised by is
tunneling, wherein the creation timestamp and short/long names of a
file are taken from a file that existed in the directory previously.
In other words, if you delete some file “File with long name.txt” and
then create a new file with the same name, that new file will have the
same short name and the same creation time as the original file. You
can read this KB article for details on what operations are sensitive
to tunnelling.
Why does tunneling exist at all?
When you use a program to edit an existing file, then save it, you
expect the original creation timestamp to be preserved, since you’re
editing a file, not creating a new one. But internally, many programs
save a file by performing a combination of save, delete, and rename
operations (such as the ones listed in the linked article), and
without tunneling, the creation time of the file would seem to change
even though from the end user’s point of view, no file got created.
...
See this archived copy of Windows NT Contains File System Tunneling Capabilities:
When a name is removed from a directory (rename or delete), its
short/long name pair and creation time are saved in a cache, keyed by
the name that was removed. When a name is added to a directory (rename
or create), the cache is searched to see if there is information to
restore. The cache is effective per instance of a directory. If a
directory is deleted, the cache for it is removed.
These paired operations can cause tunneling on "name."
delete(name)/create(name)
delete(name)/rename(source, name)
rename(name, newname)/create(name)
rename(name, newname)/rename(source, name)
The idea is to mimic the behavior MS-DOS programs expect when they use
the safe save method. They copy the modified data to a temporary file,
delete the original and rename the temporary to the original. This
should seem to be the original file when complete. Windows performs
tunneling on both FAT and NTFS file systems to ensure long/short file
names are retained when 16-bit applications perform this safe save
operation.
One Windows function related to file tunneling is FltGetTunneledName():
The FltGetTunneledName routine retrieves the tunneled name for a file, given the normalized name returned for the file by a previous call to FltGetFileNameInformation, FltGetFileNameInformationUnsafe, or FltGetDestinationFileNameInformation.
...
To disable tunnelling:
Open regedit
Navigate here:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
On the Edit menu, point to New and then click DWORD Value
Type MaximumTunnelEntries and then press Enter
On the Edit menu, click Modify
Type 0 and then click OK
Restart your computer
Done

VB.Net - Use wild card in My.Computer.Registry.GetValue

I have a VB.NET script that looks up the current version of java installed.
Everything worked great until java 8 came out.
Back in Java 7 i would do this.
My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment", "Java7FamilyVersion", Nothing)
In Java 8 (Java8FamilyVersion) is gone and has replaced with (FullVersion).
The problem is FullVersion is behind two more folders one with the version (18.0_25) Then another folder call MSI
So here is the problem; right now the first folder is called 18.0_25, but in the future it would be changed to something like 18.0.55ish.
I can't update my software that often, so i would like to use a wilcard in the getvalue
IE something like this
My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment\1.8.*\MSI", "FullVersion", Nothing)
Above didn't work is their anything that would work?
Use the GetSubKeyNamesmethod to enumerate the subkey(s) of "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment", then pick the alphabetically last (so that you do not fall for any old 1.7_xx keys or the 1.8 key)
You could grab a file version from one of the Java .dll files. Sorry, I don't have Java installed, but something like this might help you:
Dim fvi As FileVersionInfo = FileVersionInfo.GetVersionInfo("somefilename.dll")
Debug.Print(fvi.ProductVersion)
You can fiddle with the returned properties for major, minor, etc. You should be able to build a version string to get what you need.

TYPO3 6.2 / Extension-Manager: "static_info_tables was requested to be downloaded in different versions"

i have a wired problem with TYPO3. We update a TYPO3 instance from TYPO3 4.7 to TYPO3 6.2.4. If we go to the Extension-Manager in the Backend its workling well. If i go to
Get Extensions on top the system loads a new list of Extensions.
Its running some minutes. After that in the box below i get the output No packages found.
If i click again on the Extension-Manager again. Its running 1 - 2 Minutes and i get the error:
Uncaught TYPO3 Exception
#1342432101: static_info_tables was requested to be downloaded in different versions. (More information)
TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException thrown in file
D:\www\xxxx\typo3\sysext\extensionmanager\Classes\Domain\Model\DownloadQueue.php in line 69.
I have checked that line.
if (array_key_exists($extension->getExtensionKey(), $this->extensionStorage[$stack])) {
if ($this->extensionStorage[$stack][$extension->getExtensionKey()] !== $extension) {
throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(
$extension->getExtensionKey() . ' was requested to be downloaded in different versions.',
1342432101
);
}
}
If i comment the line the Extension-Manager load after a few minutes. Its very slow. Under Windows its not the fastest but normally its running.
If you output the Versions in the if statement then you get different versions static_info_tables 6.0.10 and static_info_tables 6.1.0 which is the correct one.
Does anybody know how to fix this problem? I can't use the Extension-Manager because its not loading and very very slow.
Ok after a few days we have found a solution. The extension table is corrupt after getting all new versions we have removed all old entries in the extension manager table and it was working well.
To solve the problem Find all entries in the tx_extensionmanager_domain_model_extension table for the extension key static_info_tables. After that you get some entries with different versions. We have removed all old entries that have made some trouble.
To find entries that make trouble you go to this line:
D:\www\xxxx\typo3\sysext\extensionmanager\Classes\Domain\Model\DownloadQueue.php in line 69.
And debug the if statement above. There you get the ids to remove.

VB.NET read registry

Beyond perplexed this time...
The simplest possible line of code works sometimes, sometimes it doesn't. First I thought the issue was that I was trying to read the value of a DWORD, but since I CAN read DWORD values from SOME keys, that must not be the problem. Now the problem seems to be that I can't read from ANY key if the key has a space in the name. Surely this can't be. I refuse to believe that MS didn't account for spaces in registry key paths and names.
So tell me why this doesn't work:
MsgBox(My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\CA\CA ARCserve D2D\WebService", "Port", Nothing))
It just pops up an empty box. And yes, a value does exist in the registry, and yes, I have permission to read the key.
EDIT: Yup, over and over again it seems that you can't read from the registry if there are spaces anywhere in the key name. Seriously?!?
EDIT AGAIN: "Ramhound" says code examples are stupid. Fascinating point of view. However his own suggestion also failed:
Dim key As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\ATI Technologies\CBT")
Dim objValue As Object
objValue = key.GetValue("ReleaseVersion")
MsgBox(objValue.ToString())
After an entire wasted day, the solution is to set your VS project to "any cpu" in advanced compile options because if set to x86 and running on a 64bit OS you are limited to the "Wow6432node" in the registry.
It's also worth noting than on a 64 bit version of Windows 7 while running a vb.net app in 32 bit mode, the Wow6432Node key is hidden from you when using a Microsoft.Win32.RegistryKey object. I'd written this code to check which key I needed to read to get the right ODBC Driver subkey:
Dim myReg As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine
Dim myReg_Key As Microsoft.Win32.RegistryKey
myReg_Key = myReg.OpenSubKey("SOFTWARE")
strRegistry_Keys = myReg_Key.GetSubKeyNames()
bool64_Bit_OS = False
For Each strSub_Key As String In strRegistry_Keys
If strSub_Key = "Wow6432Node" Then
bool64_Bit_OS = True
End If
Next
When you do a GetSubKeyNames() on the "SOFTWARE" key you are redirected to SOFTWARE\Wow6432Node
This does make it easier for my code as now I don't need to work out which subkey to look in to find which Oracle ODBC driver to use.
Kristian

Detect Operating System

I would like to know how to detect if a persons operating system is Windows 7, I'm a bit new and have no idea how to do this. Please let me know if it is possible and the code to do it.
See the Environment.OSVersion property on MSDN. It is a static property that returns an OperatingSystem object, which has a Version property and you can just check the Major and Minor version numbers to see if it is 6.1 (Windows 7 is actually version 6.1).
Dim osVer As Version = Environment.OSVersion.Version
If osVer.Major = 6 And osVer.Minor = 1 Then
Console.WriteLine("win7!!")
End If
It's easy to use My.Computer.Info.OSFullName.
you need to set up the app.manifest file to get the correct version number. even System.Environment.OSVersion.ToString() ' not gives the correct version if you have not been set the app.manifest
add an app.manifest
Console.WriteLine(My.Computer.Info.OSFullName)
Console.WriteLine(My.Computer.Info.OSVersion)
Console.WriteLine(My.Computer.Info.OSPlatform)
Output:
Microsoft Windows 10 Pro
10.0.18362.0
Win32NT
I'm guessing since you're a bit new that you're actually using VB.NET rather than classic VB 6.
In VB.NET, you can use:
Dim osVersion As String = System.Environment.OSVersion.ToString()
I would use
My.Computer.Info.OSFullName