Solved Why do I get this blocked VBS file error?


Thanks Mr @Brink :thumbsup:
Again, I didn't read it carefully and thought it would be deleted forever, and there is no way back!

Further in the future (number of years again unknown) VBScript may be removed altogether with no option to add it back.
I meant this part of the story. Out of curiosity, is there a way to convert the VBS file to a format that Windows supports natively, like Powershell (BAT) file?
 

My Computer

System One

  • OS
    Win 11 Enterprise
    Computer type
    Laptop
    CPU
    i7
    Hard Drives
    SSD
I meant this part of the story. Out of curiosity, is there a way to convert the VBS file to a format that Windows supports natively, like Powershell (BAT) file?
VBScript is supported natively, but I guess you mean in the future when that's no longer the case. I think that's a long way off. When you consider that Internet Explorer is still included with Windows 11 (that's how Edge IE mode works), and SMB 1.0 is still available to install with a simple click, I expect VBScript to remain installable with a simple click in Optional Features for many years to come.

For conversion from VBScript, I wouldn't consider batch files. They're too limited. But PowerShell is a good option. The irony is that even people who are die-hard PowerShell fans still use VBScript to launch their PowerShell scripts silently. Microsoft wants to take that capability away because of malware that takes advantage of that. For short scripts, ChatGPT is pretty good at translating code, but I wouldn't bother at this point. There are a lot of applications that use VBScript (with their own custom objects) to provide scripting (aka macro) capability within their application. Microsoft has to leave VBScript available as an optional tool for those applications. Also, a lot of organizations still have VBScript code in production.

Note that Microsoft has said nothing about removing JScript which, as a security risk (i.e. attack vector) is identical to VBScript. So, you could convert any VBScript code to JScript (or get ChatGPT to do it) but I think that's mostly pointless, unless you are distributing a script and don't want to have to tell users (in the future) to go to Optional Features and install VBScript. When (if) we get to the point where VBScript is no longer available under Optional Features, I expect Internet Explorer will be totally removed by then as well, which would mean there would be no reason for Microsoft to keep JScript around either. That's too many years way to worry about it.
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer
I think that's a long way off. When you consider that Internet Explorer is still included with Windows 11 (that's how Edge IE mode works), and SMB 1.0 is still available to install with a simple click, I expect VBScript to remain installable with a simple click in Optional Features for many years to come.
I doubt it. It was embedded in various types of computers (office, business, and personal) for over twenty years. To discontinue it abruptly would be a shock for Microsoft. However, these days, Microsoft has been expiring options at a blazing speed, especially with the help of CoPilot.

But PowerShell is a good option.
I have seen many PowerShell files on GIT, and I'm wondering how they are written in such a cool way to accomplish a task. Unfortunately, I am not familiar with coding using PowerShell.
 

My Computer

System One

  • OS
    Win 11 Enterprise
    Computer type
    Laptop
    CPU
    i7
    Hard Drives
    SSD
Thanks. I wish all these were in the form of a book and offline.
 

My Computer

System One

  • OS
    Win 11 Enterprise
    Computer type
    Laptop
    CPU
    i7
    Hard Drives
    SSD
I have seen many PowerShell files on GIT, and I'm wondering how they are written in such a cool way to accomplish a task. Unfortunately, I am not familiar with coding using PowerShell.

One of the interesting things about PowerShell is just how wildly different code varies for the same task. It has a lot to do with the fact that PowerShell is heavily object oriented. The kids that grew up with object oriented programming are going to code in PowerShell considerably different than a dinosaur like me that programs with a more procedural or functional approach. So, when you see code with a lot of dot this and dot that and one thing piped to another, keep in mind that that's just one way of getting the job done.

I wish all these were in the form of a book and offline.

I've learned many programming languages, but rarely using books. I like to get right into coding and see things happen. My new favorite way to learn a new programming language is to use ChatGPT. I can give it some code in another language and ask it to translate it into PowerShell. Or, even cooler, I can write something in pseudocode and ask ChatGPT to give me the PowerShell equivalent. The code it produces comes with explanations, but I can ask it to for more details. I can ask it to make the code more human readable or less verbose or more verbose or less use of objects and pipes, so my mind can get around it. Whatever. It's like having your own personal tutor who never gets tired. And yes, sometimes the code ChatGPT generates is incorrect. That's part of the fun. You test it and come back with the error and see if it can help you sort it out.

P.S. I should note that I still make heavy use of the reference guide for whatever language I'm using. It must be online and searchable to be of any use to me.
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer
... when you see code with a lot of dot this and dot that and one thing piped to another, keep in mind that that's just one way of getting the job done.
The advice was helpful :thumbsup: .

but rarely using books
I have trouble reading books on screens (my eyesight is fine, and I have no problem). If a PDF is less than 50 pages, I can read it on my screen, but if it's more than that, I have to print it out and read it by hand (when I read, I love the feeling of holding and touching physical books). I have two large bookshelves, and about one-third of the books on them are printed PDFs. I'm not a nerd/bookworm, and I don't enjoy reading excessively. I'm just very curious about topics that interest me.

Online resources force me to (always) be connected to the internet and confined to my computer. I have to jump from one URL to another, which can be distracting. However, with a physical book in my hands, I can go to a quiet location like a jungle and read while being surrounded by the symphony of nature (which I love!).
 

My Computer

System One

  • OS
    Win 11 Enterprise
    Computer type
    Laptop
    CPU
    i7
    Hard Drives
    SSD
However, with a physical book in my hands, I can go to a quiet location like a jungle and read while being surrounded by the symphony of nature (which I love!).
Good point, and don't get me wrong, I do enjoy physical books (or my Kindle e-reader). I just haven't used books much for learning programming languages. But I probably could benefit from a good read (in a nice location) on object oriented programming. 😉
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer

My Computer

System One

  • OS
    Win 11 Enterprise
    Computer type
    Laptop
    CPU
    i7
    Hard Drives
    SSD
Apologies for the late reply.

That's very strange. Normally, no rules are in place there and all scripts run just fine from pretty much anywhere.

Since you've probably had a few updates in the meantime, I suggest removing those rules and see if normal behavior has returned.

I didn't have these rules in App Locker originally. I just received them when I performed an in-place upgrade.

@Bizarre and @atinfo...

Also note that, when those entries are in place, PowerShell scripts run in Constrained Language Mode, unless you elevate them via "Run as administrator".

I'm aware and I actually prefer it.
 

My Computer

System One

  • OS
    Windows 11

Latest Tutorials

Back
Top Bottom