Windows
Last updated
Was this helpful?
Last updated
Was this helpful?
DCli ships with a number of Windows specific functions and classes.
Under the hood DCli uses the package which we recommend if you need additional Windows specific functionality.
The DCli Windows methods also rely heavily on the win32 package's constants such as HKEY_CURRENT_USER
so in most circumstances you will need to import win32.
To add win32 to you dependencies.
To access the Windows specific APIs you need to import the windows barrel file.
The Windows Registry is unique to Windows so if you want to write cross platform scripts then you should avoid using the Registry. However in some circumstances this simply isn't possible
In this case use the Platform.isWindows
method to determine when to use the registry.
DCli includes:
Appends [newPath] to the Windows PATH environment variable.
Returns true if the given [path] is on the user's path.
Prepend [newPath] to the Windows PATH environment variable.
Gets the User's Path (as opposed to the system path) as a list.
Sets a Windows registry key to a string value of type REG_SZ.
Sets a Windows registry valueName with a type REG_NONE.
Gets a Windows registry value o0f type REG_SZ [hkey] is typically HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE.
Sets a Windows registry key to a string value of type REG_SZ.
Reads a DWORD from the registry.
Deletes an registry key.
Deletes an registry key.
Retrieves a registry value located at [hkey]/[subKey]/[valueName] that is of type REG_EXPAND_SZ.
Sets the [value] of the [hkey] located at [hkey]/[subKey] in the Windows Registry. The [value] is set to type REG_EXPAND_SZ.
Tests if a registry key exists.
Creates a registry key.