When you log on to your computer, the error “Can not find script file C:\WINDOWS\run.vbs” with Windows Script Host in the title is shown on a blank screen with a black background. This happens if malware has modified the Userinit registry value, replacing the Windows default value data with a VBScript filename.
Important #1: This post explains how to fix the Userinit value and thereby helps you get access to your user profile. At the same time, the malware that caused the problem in the first place might still be active and lurking in the system. And in this case, the problem seems to have been caused by a complex malware that adds core components to the system making the removal process difficult. So, it’s highly advisable to get your system professionally checked for malware and eliminate them entirely.
Fix the Run.vbs error by correcting the Userinit value
Note: If Task Manager doesn’t open due to DisableTaskMgr Policy enabled by the Malware, carry out the following procedure via Recovery Environment. Check out the article How to Edit the Registry Offline Using Windows Recovery Environment? for more information.
- After typing the login credentials, the system may stall at Preparing to the login screen. Press Ctrl + Alt + Del, and click Task Manager.
- When the above error message dialog is visible, dismiss the dialog and switch to the Task Manager window.
- The file referenced in the
Userinit
registry value is run even before the user interface loads. To start the Explorer shell, switch to the Task Manager window, click File, and select Run new task. Type explorer.exe and press ENTER. - Start Registry Editor (Regedit.exe) and go to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
- Double-click Userinit value and change the value data from:
wscript C:\WINDOWS\run.vbs,
to the following: [Caution: Take special care when entering. You need to remove the wscript part.]
C:\Windows\system32\userinit.exe,
*Important #2*: If Windows is installed in a different drive than C:\, type the actual drive letter and path. Also, include the trailing comma (,) as shown above. Take extreme care when typing the Userinit value, as typing an incorrect filename or path will prevent you from logging on to any user account. I’m not responsible if you type a wrong path and lock yourself out of your user account.
- Exit the Registry Editor.
- Log off and login back in so that the Userinit.exe loads correctly and does the initialization or preliminary jobs like running logon scripts etc.
This fixes the run.vbs login error message. Although the Vbscript file run.vbs may have been deleted by your anti-virus software, running a thorough scan is still advisable.
One small request: If you liked this post, please share this?
One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:- Pin it!
- Share it to your favorite blog + Facebook, Reddit
- Tweet it!
Thank U so very much.. its really worked.
Hey !Thank you very very much you saved my life…i owe you..
Thank u so much for fixing the problem
Thank you so much! You saved my life 🙂
Thanks dude, it helped me a lot
Thank you very much
Your post save me today
Thanks, thanks a lot. Grazie grazie mille!!!!
Thank you so much for this you saved me !!
It works.Thanks!!!!!!
🙂 God bless you !!!
windows 10
Thank you very much for the solution!
I’m very happy thanks man you are awesome
Yes, I see “it’s still advisable to run a thorough scan.” but this is not so easy to remove especially rouge software called “MPC Cleaner” which is installed by this infection. I don’t think anti virus scan will remove it.
It uses minifilter driver (MPCKpt.sys) to attach itself to hdd partition to prevent deletion of MPC Cleaner. Its practically impossible to remove it under normal mode in windows. But it can be easy deleted using WinRE or Linux Livecd.
@Abdulla: Thanks for the note about the filter driver. I’ll add this note at the top, plus a link/redirect to an appropriate security forum.
Your doing such a great things man
Your a saint man thank you
Epic! I love you all !!! Hahaha
Thank you soooo much it really helped me out
wooo amo a quien escribió esto , intente mil veces a que funcionara con otros vídeos y cosas . y solo esto fue la mejor ayuda, solo una palabra para que funcionara …. explorer.exe 🙂
It worked!!! Thank you so much!
Man, you really saved my day, tried a whole bunch of solutions prposed both from HP themself as well as a variety of forums.
Thank you very very much! !! Works well..thank you !!!!
Thank God I have two computers. Thank you sooo much!! This really works. I wouldn’t know what to do other than take the computer in for service which could cost me at least $50.00 or more. You made my day!! Now I need to run some kind of spyware software as this bug that was put into the computer cause this error.
thank you so very much it was easy but so hard to find the proper answer
Thank you so much. Clever people for President!
Oh you really saved my computer, i thought it way dead!!! Thank you!!!
Can you recomend any good malware cleaning programs?
thanks! This worked! Love love love
Thanks a lot! you just saved me and my computer
BLOODY MASTERMIND YOU ARE!!!!!!!GOD BLESS YA FOR SHARING YOUR EXPERTISE AND KNOWLEDGE!! SUPERLY DUPERISHLY GRATEFUL!!!!!!!!!THANK YOU.!!!! MAY THA BENEFICIAL KARMA ANGELS ENSURE MULTIPLE BLESSINGS UPON YOU AND YOUR LIFE ? !AMEN!
THANK YOU, you literally saved my life. Ahah ok not that extreme but I had loads of assignments to do. Thank youuu???? God bless
Thank you so muuuuuuuccch ❤❤❤❤
thanx aloooot,,,it was very helpfull 🙂
Thank you man, this was driving nuts! the malware that caused this was nimeckreelule, is the same NMCLOGSERVICE.EXE, which installed bunch of crap like badu, tencent QQ, yesplayer, yesbdn, uc browser, etc. God damn chinese crap.
Hi. I have the same problem, the thing is I cannot even open it. Everytime I turn it on, it asks me for a password then I put it in. After that, the message comes out (the same as on above). please help me… anyone?
@leoonard: Try editing it via Windows RE. REF: Edit Registry Offline Using Windows RE
Thank You Please keep posting
Thank you, I’m very happy now, the logon is more fast.
Thank you
//It won’t allow me to change the value since I am not using the admin login. But the admin login has vanished, so I can’t use my admin login.
What if the file isn’t there at all? ‘wscript C:\WINDOWS\run.vbs,’
Is there a way to create a new one that does the same thing?
thankssssssssssssssssssssss………..
i love you you are awesome
Really
I donot know how can i thank you
There are not words can explain this
Because you saved me and my important files
Thanks dear very much
thanks this tutorial saves my day 🙂
saved me by inch thanks
Does this work on a 64 but or do I have to replace the 32 with a 64.
genio!! me salvaste un trabajo bastante dificil
Thankyou very much. It really helped me a lot.
Accolades to the dude that posted this solution. I had a nightmare run going from a PUP infected Win 8.1 to Windows 10. I cleaned all the virus crap from 8.1 but then was left with a Microsoft “Upgrade now” dialogue box but no way to close it. The options were “upgrade now’ or do it on one of the next four days. I bit the bullet and did it, and that’s when I hit this black screen with cursor and a minimised Windows Script error window. Anyhow, tried the above, and it got rid of the Win Script window, but I still had the black screen and cursor. After lots of agonising I reverted to Win 8.1 and performed the same steps as above. Cold booted, and all was well again. BTW when I looked at that UserInit setting in Regedit it showed a value of “wscript,” only. I haven’t tried upgrading to Windows 10 again, but if any of you dudes are game enough to give it a shot then I’d love to know how ya go. nb Mine is a Lenova laptop with NVidia.
Thankyou very much your tutorial work , Success Brother
Thanks so much ! 🙂 #Relieved
Come on man you are my angel. You saved my day. It works thank you very much, man.
thanks a lot man…..
made my day.
you gooooooood your solve is number 1
gracias bro, muy buena explicacion
Master!!! Solucionaste mi problema. Muchas gracias!!!!!
Weird, I saw this prompt, then I launched “explorer.exe”, then my desktop just loaded.
Guess this malware’s a puss.
When I typed this, I still get a black screen. Now I just dont get the message.
I felt a huge weight go off my chest, Thanks to whoever wrote this you are a real life saver, The fact is i’m using my mother’s computer right now and she usually blames me for anything that happens to it so when i saw the error message i thought “My mom’s gonna kill me -_-“
Thank you very much. I got it with your method.
Thank you very much 🙂 really great (y)
My brothers . things he said was fine . But many of your laptops is not fixed right now also . so I can fix. it step 1- open any of your anti malware protection software like byte fence[ I handle my situation with this software only] and just scan your computer
Thank you very much!! You saved me,
I to would like to thank you
Thank you so much sir it fixed
I too have the same problem but want to know if it works
with win 7, 64 bit? do i have to edit C:\Windows\system32\userinit.exe, to C:\Windows\system64\userinit.exe,?
THANK YOU!!! Was locked out of my computer, 3 hours later, after reading this article, the only article that worked!!!
I’m up & running again!!!
I’m reinstalling malwarebytes, it has found 152 detected objects, so far, still running.
My computer totally fried after I started downloading an Obvious malware file, I tried to stop download. UGH. My mistake, I know better, but normally I can find, delete malware manually. Today, was totally locked out of my computer.
Life Lesson.
THANKS soooooooooo MUCH!
Kim
THAAAANKKKSSSSSSS.. Its really works…!!!
Thank you very very much! Wishes from Greece!!
Thanks a lot. It really worked and helped me.
Thank you so much!!!!
Thank You sooo much 🙂 It Realllyy Helped 🙂
Thank you, Its working.
I don’t know how to thanks you.
big kiss
it actually worked just in the second step!! ty!
Thnking you for giving such a good explanation
I have solved my problem through this guide
Thanks
Thanks Man !
Everything was failed to run till I typed “explorer.exe” and run it , then everything came back to live ! Start Menu , Desktop , … etc. everything came back to live !
Shukrann <3
Thanks you so much for your article, its really works
Thank you very much 🙂 🙂 🙂 It really worked and helped me. Petr
I gives me the message :Error writing the values new contents
Thanks a million. I am very relieved to see my computer running again. God bless you.
Hi
I just type “explorer.exe” , but what comes out is “C:\windows\system32\config\systemprofile\desktop refers for location that is unavailable…….”
How to fix this? Thanks
Thank you so much. Its works.
Thak you so so much i still a week search to fix this problem
Omg this post helped couldn’t think of one to use and I just fired the gun and tried it, it actually worked, God bless u. 🙂
I tried and this is what i keep getting
cannot edit Userinit: Error writing the value’s new content
24 hrs headache had gone in no time. Your professional advise and well structured instruction had been key to get me out of trouble. It is really awesome. Thanks a million!
works 😀
Thank you, this information really usefull
Thank you so much!!!!!!!!!!!!!!!!!!!!!!!11
thanks, it helps me fixing my partner’s pc on the office
I did exactly what you said except I used system64 instead of system32 as I’m running Windows7 -64 and it rebooted all looking good at first but now I’m stuck with a completely black screen and now I have no computer at all. at least before I could use it, it was just real slow with that Error message.
system64 is not a valid path. You must use system32 – both for x86 and x64 systems.
It works!
Thank you so much!
Very thankful to you. It worked.
I’ve been stucked for Months with this black screen.
You’re the MAN! Thank you.
Thank you very much! You are truely a genius! I downloaded some type a maliware/virus today and your step by step video worked! Thank you and god bless!
Thank a lot, i had many problem, and i fixed with your tutorial. Expert! Great man! Thank thank thank you so so so much! Good luck and all the best!
Dude, this work perfectly. Thanks alot.
Saved me!
The file “run.vbs” isn’t missing for me. Thing is a malware was deleting it until i noticed some really suspicious activity in my background processes. I then manually killed that task, only to realize it was a malware. Luckily, none of my files got deleted. However, in run.vbs, a specific value was changed during the deletion process. I hope you can help me figure out what that value is. I already have VBS programming experience. Its only the value i’d like to know. Thank you and i hope you answer soon.
I tried and this is what i keep getting
cannot edit Userinit: Error writing the value’s new content
Thank You! 😀 I could fix it.
THANK YOU SO MUCH FOR THIS. OMG. I THOUGHT MY SISTER WOULD HATE ME FOREVER. THANK YOU SOOOO MUCH.
It works… all my worries Gone In a Minute
The best troubleshooting tip I have received for a long, long time! Thank you!
Thanks. Worked for me.
thank you very much ! it works 😀
Thank you 🙂
I don’t have a file, what should I do?
It worked perfectly fine thanks i appreciate
Saven me, thanks!
I can’t fix these problem cause,there s after disabling the error msg I cant open explorer.exe file in the task even I typed with browsing file
@ hidhayadhulla: In the Task manager, create a new task named “explorer.exe” from the File menu.
thank u, it really works
I have got this issue for more than a week in my Asus R558u notebook. I was installing Kaspersky Antivirus and some files are downloading at that time. But suddenly it start opening explorer tabs and some other things. I tried to close it, shutdown my Pc, But nothing helped the desktop is freezed. So i shutted it down from the power key by pressing it for some time.
And after that when i turned it on, after filling the password of Windows, the Black Screen with cursor welcoming me with this Script Host Error thing. Now its showing cannot find the vbs file and all.
I am unable to open the task manager. But from the cmd i opened regedit and done as you have said but the value is right there, nothing about vbs.
On entering safe mode after it, the Windows start the Blue Screen Loop and restarting again and again.
Please help, what should i do.
@Shubham: Pls post the exact error message verbatim. Also, try Autoruns startup management tool to see what programs are loading at startup.
but i can’t open tast manager, if i press ctr+shift+esc, nothing opened
Thanx man it works
I try this but i am unable to open tast manager, if i press ctr+shift+esc, nothing open. Please help me out
It’s amazing since this is the ONLY actually working solution to the problem! I spent 4 hrs on my wife’s PC yesterday trying it to boot cleanly again after a malware infection and cleanup with malwarebytes and other virus checkers. The funny thing is that the infection was not even the problem (this could be solved relatively easily), the problem was the remaining “wscript” part instead of the userinit in the registry. (Which, after finding this post, I could correct in less than a minute).
What’s “amazing” is that NO ONE on Microsoft tech forums or malwarebytes forum or anywhere else had a reply for fixing this.
Instead, the malwarebytes forum and MS forum recommended entirely unnecessary things, like running “Defender offline” (which didn’t work at all since it cannot update definitions from the USB stick) or running “rogue killer” for scanning for root kits etc etc. which took me 90mins for a scan – but ALSO of course didn’t solve the problem since the wrong “wscript” entry was still in the registry preventing the PC from boot. (You can run virus checkers until you are blue in the face, they won’t correct the entry in the registry!)
What’s “funny” is also that no run of malwarebytes or NOD32 or whatever actually SPOTTED the problem and advised to correct it, and even worse (and even more bizarre) a system restore to last Friday before I had the infection (and then also booting from “Last Good Configuration”) did not restore the computer for a proper boot, the corrupt registry entry was *still* there and giving black screen on boot. (Which baffles me since I could’ve sworn that taking “last good configuration” or a system restore would actually use a registry backup).
The funny part is that it was at some point very obvious that the PC *was* actually cleaned from all malware and that the PC “in principle” worked since you could enter CMD shell from the black screen and then run “explorer” to start windows. It was very clear that “something” still tried to run script (wscript), but that the dangerous script was removed and that the PC “hung” because of this remaining entry in the registry. (Simply describing to someone “black screen with wscript error after removal of malware with malwarebytes” should *immediately* bring someone to *THIS* solution, and not to entirely useless and incompetent blahblah which has nothing at all to do with actual problem – since the issue and fix are NOW actually obvious, once you learn what the issue was)
Let me just estimate that hundreds of people who possibly run into the same problem after an infection “solved” this by having to entirely reinstall their PC…which is a joke seeing that the fix was a matter of seconds which could have saved them re-installing their PCs. And all the “experts””giving advice” on the internet…if you mention to them that this is a wscript error before boot and they instead just tell you to scan your computer again [pointless, since the malware was already removed] from safe mode or recovery console..it’s very clear these people have no clue whatsoever what they’re even talking about. In particular since this seems to be rather common after infection and cleanup with malwarebytes)
Anyway I want to thank you very much since you not only helped me to make the PC bootable again…I also learned something valuable which can help me the next time should I run into this. Sorry for the long rant..I was just angry to read all the “experts” yesterday which served only that I wasted many pointless hours yesterday at night UNTIL I came across your post!! THANKS!!!
Georg: Thanks for the feedback. It’s strange how NOD32 or MBAM missed the run.vbs infection in the first place. Incidentally, I purchased a MBAM Premium license y’day. The web protection part is working fine as I see.
Hello,
I can not run the taskmanager . Have win 10.strg+win+entf. or win +x win +r no function
Please help me.
greetz from germany
@Tina Mueller: Pls try offline registry editing method here.
Thank you so much
Accept my sincere love and respect
I went to the maintenance shop has no solution but to change Windows only
The problem has been overhauled.
You rock!
I was already thinking of how to change firmware but with this I fixed it in no time without spending a dime. thanks a lot.
You rock!
Thanks a Ton!!
Thank you bro!
Mil gracias!!!
Thank you as so much, fixed within a minute!
It worked for me too! Thanks a bunch!
Thank you veryyy much
Working like magic – thanks man!
WORKING!!! LOVE U
thanks man 😀
Thanx a lot I thought I no longer had control of my pc
Thank u so much for this now I can get the virus off my computer thank u man
2/18/17
Thanks much!
Thank you so much. You are a blessing to many, including me. I owe you one. It helped so much.
nice! Thanks..
I tried to change a name on a file under users registry, now it will olny let me log in to a temp profile
I get this message
‘an app caused a problem with the default app settings for MS-xb1-3d8b930f files”
how would I fix this?
Thank you very much