What is the reason for the error message '/hostfxr.dll is either not designed to run on Windows is it contains and error'? - windows

I just opened a PowerShell console on Windows 11, and after running any command, it showed a dialog with a message like:
/hostfxr.dll is either not designed to run on Windows is it contains and error
Any ideas?

Just download the last hostfxr.dll from this website and copy it to this directory:
C:\Program Files\PowerShell\7

Related

PowerShell Get-CimInstance creates popup to select files

When I execute the Get-CimInstance command in a Window 2016 Server, it is showing a popup to select "How do you want to open this file?". Screenshot attached. The same command works fine in other servers.
How to fix this issue? Is this PowerShell issue? I have the latest version of PowerShell.
enter image description here
I think because it's not running the command that error can be found before the execution in PS. It's not running it and checking with you what to run that command with. Weird that it's doing that. Anyone else use that server or just a lab?
Check the setting where it shows your 'default apps by type'. [.psc1](Windows Powershell Console File) needs to be set to Windows Powershell. [.ps1] should be set to notepad.

Error 1067- on start OpenSSH by net start opensshd in windows cmd

I try to start opensshd app by following command line: net start opensshd but i encounter below message after press enter in CMD:
The OpenSSH Server service is starting.
The OpenSSH Server service could not be started.
A system error has occurred.
System error 1067 has occurred.
The process terminated unexpectedly.
i install openssh.
please Help Me!
I got the similar problem that i cannot startup the "OpenSSH SSH Serve" service after following the instructions in https://hostadvice.com/how-to/how-to-install-an-openssh-server-client-on-a-windows-2016-server/
I later on found out that this is the security problem in the C:\ProgramData\ssh\ssh_host*key files. All the key files in this folder should ONLY be owned by following 2 system users:
BUILTIN\Administrators
NT AUTHORITY\SYSTEM
In the Powershell under the C:\ProgramData\ssh folder, issue following command can list out the owners of the file ssh_host_dsa_key:
PS C:\ProgramData\ssh> icacls .\ssh_host_dsa_key
.\ssh_host_dsa_key BUILTIN\Administrators:(F)
NT AUTHORITY\SYSTEM:(F)
xxdomain\otheruser:(M)
Successfully processed 1 files; Failed processing 0 files
Obviously we need to remove the user "xxdomain\otheruser" from the owner list
Resolution
Updated on Nov 25, 2019: Found out that the OpenSSH-Win64.zip file already contained a powershell script: FixHostFilePermissions.ps1
What you need to do is to run following inside the powershell:
cd 'C:\Program Files\OpenSSH-Win64'
.\FixHostFilePermissions.ps1
And press 'Enter' for each question to update the permission.
just write this command in PowerShell
cd 'C:\Program Files\OpenSSH-Win64'
.\FixHostFilePermissions.ps1
then press enter .
I got this error, and it turned out in my case to be an error I'd made editing sshd_config, so be sure to check this. Spent ages trying to diagnose this.
Hope that saves someone some pain.
I got the same error by installing OpenSSH on Windows 7...
Open "services.msc" and try to start the service from there.
If it still doesn't work then you can try to follow the steps in this tutorial:
http://www.techpaste.com/2015/06/windows-ssh-server-setup-and-configuration/
One important thing: Try to download an older version of OpenSSH
Download Link: http://www.mls-software.com/opensshd.html#botpage
(I recommend you the version "setupssh-7.3p1-2")
Hope it works
Cheers
For me the solution was to download and install an MSI from this github repo

Unable to start Cassandra DataStax DDC Server

I have a fresh installation of Cassandra 3.7 with DatStax DDC in Windows. I am trying to start the Cassandra database as a service.I am using net start DataStax_DDC_Server to start the service. The service is not starting and exiting without reporting an error. I am getting the following error in the logs.
java.lang.RuntimeException: Failed to create failed snapshot tracking file [C:\Cassandra\.toDelete]. Aborting
at org.apache.cassandra.db.WindowsFailedSnapshotTracker.deleteOldSnapshots(WindowsFailedSnapshotTracker.java:99)
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:177)
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:585)
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:714)
What is causing this error and how do I fix this?
Look at the logs in the installation folder. E.g. c:\Program Files\DataStax-DDC\logs.
The datastax_ddc_server-stderr.xxxxx.log will give you details about what the problem is. For me the error was cdc_raw_directory is missing and -Dcassandra.storagedir is not set so i opened c:\Program Files\DataStax-DDC\apache-cassandra\conf\cassandra.yaml, found the cdc_raw_directory setting and simply uncommented it.
After fixing that you also get an Error when you will try to run cassandra.bat from command line.
it will tell you that \conf\\\hotspot_compiler cannot be found
Fix:
go to C:\Program Files\DataStax-DDC\apache-cassandra\conf
modify cassandra-env.ps1
just change CASSANDRA_CONF\conf\hotsport_compiler
to CASSANDRA_HOMEconf\hotsport_compiler
WITHOUT the backslash... this is not a typo ^^
finally cassandra.bat will start and cqlshell will work.
.. then close the command window where you started cassandra.bat (as admin) press CONTROL+C
..and finally you can start the service as admin: net start DataStax_DDC_Server
Below is the process that i followed to get my cqlsh working on windows 10 (64 bit)
Msi Installation file used : datastax-ddc-64bit-3.9.0
After i have installed datastax:
1) Opened cqlsh, it started closing on me.
2) researched answers in stack overflow and found that i need to add raw directory.
3) Based on TugboatCaptain answer I enclosed cdc_raw_directory based on my installation folder in conf\cassandra.yaml file
4) Opened Errlog file and noticed there is mistake showing in the path "C:\Program Files\DataStax-DDC\data\cdc_raw" at "\DataStax-DDC" error while scanning double quoted scalar.
5) I removed "\" before "DataStax-DDC" from cdc_raw_directory value in conf\cassandra.yaml file and started Datastax DDC Server 3.9.0
6) Opened again the Err file and noticed the error is shifted to "\data"
7) I removed "\" from cdc_raw_directory in conf\cassandra.yaml file and saved the file and started Datastax DDC Server 3.9.0
8) Opened again the Err file and noticed the error is shifted to "\data"
9) repeated the process of removing "\" and saved the file until i was able to start the service.
10) Finally my service started, Hope this helps and also attached screenshots from my pc.
Finally my cdc_raw_directory value looked like below:
Final Image from "conf\cassandra.yaml" once my service has started
This is the my cqsl shell screenshot
Mylog file(logs\datastax_ddc_server-stderr.2019-03-24.log) screenshot
I had the same problem (I'd start and it automatically says service stopped). I got it fixed as follows:
go to C:\Program Files\DataStax-DDC\apache-cassandra\conf
edit cassandra.yaml
change
cdc_raw_directory: /var/lib/cassandra/cdc_raw
to:
cdc_raw_directory: "C:/Program Files/DataStax-DDC/data/cdc_raw"
Make sure that there are no spaces before "cdc_raw_directory" i.e. not " cdc_raw_directory" because Python is space sensitive
Try running the CMD prompt as administrator, that fixed the problem for me.

Getting the `The application failed to initialize properly`/3221225794 error executing a batch file

There is a scheduled task that is attached to a custom event in the EventLog, it executes the lines below:
reconnect.cmd
c:\windows\system32\rasphone -f "phone_book.pbk" -d "vpn_connection"
net stop my_windows_service
net start my_windows_service
The task ususally runs normally without errors. But sometimes it returns error The application failed to initialize properly (3221225794). The task is configured to run under system account so it is supposed to have all required permissions to run that batch script.
Why do I keep getting this error? What can cause it and how do I debug it?
edit: start in option
The task uses "D:\" as working directory/start in location. The reconnect.cmd script is located at "D:\". Can this be the cause?
I posted this article earlier today on how to decode errors Error 2147463168 when trying to bind to an AD User Object
//
// MessageId: STATUS_DLL_INIT_FAILED
//
// MessageText:
//
// {DLL Initialization Failed}
// Initialization of the dynamic link library %hs failed. The process is terminating abnormally.
//
#define STATUS_DLL_INIT_FAILED ((NTSTATUS)0xC0000142L)
3221225794=0xC0000142 (use calculator)
This should identify which process (cmd or rasphone) and which dll.
You can also start in a debugger.
windbg or ntsd (ntsd is a console program and maybe installed). Both are also from Debugging Tools For Windows.
Download and install Debugging Tools for Windows
http://msdn.microsoft.com/en-us/windows/hardware/hh852363
Install the Windows SDK but just choose the debugging tools.
Create a folder called Symbols in C:\
Start Windbg. File menu - Symbol File Path and enter
srv*C:\symbols*http://msdl.microsoft.com/download/symbols
then
windbg -o -g -G C:\windows\system32\cmd.exe /k d:\batfile.bat
You can press F12 to stop it and kb will show the call stack (g continues the program). If there's errors it will also stop and show them.
Don't know why but running tasks under SYSTEM account was the cause. When we changed the account simply to local admin tasks ran flawlessly.

error registering mscomm32.ocx

Can somebody tell me how to register mscomm32.ocx. I pasted it in system32 and then tried to register using "regsvr32 c:\windows\system32\mscomm32.ocx" . Even then i got some error message something like this:
"the file was loaded but it is unable to register error 0x8002801". I use 32 bit OS Windows 7
I would be pleased if someone helped me with this.
You may need to run in it as an administrator. My recommendation would be to start a command prompt as the administrator (right-click on the Command Prompt icon in the Start menu and select "Run as Administrator").
That's a guess based on this article - DLLRegisterserver failed with error code 0x8002801

Resources