Reputation: 601
Is there any way to make a .vbs file Read only,so that no one rather a specific person can read the content or change the content? But only can double click on that file to start its execution. I will set up a Main.vbs into which I would put the below
Dim oShell : Set oShell = WScript.CreateObject ("WScript.Shell")
oShell.run "A.VBS", 1, True
oShell.run "B.VBS", 1, True
oShell.run "C.VBS", 1, True
oShell.run "D.VBS", 1, True
The user will click only on the main.vbs to start the execution. All the .vbs I want to be Read/write protected. is my thought possible in practice?
Thanks,
Upvotes: 0
Views: 4851
Reputation: 1
If the purpose of this is to protect your code, then you can always make an executable file.
Upvotes: 0
Reputation: 412
Some other options to consider. The script can be encoded with the Microsoft Script Encoder. This will make it unreadable. One download link here (can't find the official Microsoft download link) http://www.softpedia.com/get/Programming/Packers-Crypters-Protectors/Microsoft-Script-Encoder.shtml. Of course, it is possible for people to decode the file using the appropriate tool.
Another option is to digitally sign the script with a code-signing certificate. This will still allow it to be viewed, but it will not be able to be modified without breaking the digital signature.
Or even encode the script then digitally sign it.
Upvotes: 0
Reputation: 200203
If you can't read it you can't run it.
You can set permissions so that no other person (except administrators) can change the file, but you can't prevent people from being able to read the file if they're supposed to be able to run it.
Upvotes: 2