ABC Dave
ABC Dave

Reputation: 29

Saving notepad file as a .vbs

I'm trying to save some code in Notepad as a .vbs file but for some reason Notepad keeps saving it to my desktop as a .txt, so I can't run the program.

I've tried every way of saving it, putting it in brackets when saving, giving it different names, completely deleting and redoing the code; but it just won't save a .vbs executable.

Not sure if I've missed something simple, it had worked before and I'm not doing anything different.

Upvotes: 0

Views: 38651

Answers (4)

user15770843
user15770843

Reputation: 1

Let the file be in .txt format, Follow below instructions once you have saved the file in .vbs but still the file appears to be in .txt format:

  1. Right-click the file that you saved and click "Properties."
  2. Click the "Change" button and double-click "Microsoft Windows Based Script Host" to restore the association.
  3. Select "wscript.exe" and press ok. press apply and ok button in properties window. this saves your file in .vbs format.

Hope this answers the question. NOTE: If you cannot find "Microsoft Windows Based Script Host" item, click "Browse" and go to the "System32" folder inside your "Windows" folder in your c: drive.

Upvotes: 0

Moir
Moir

Reputation: 387

If you have already saved the document and you are showing something like the following with a VBS extension but the Type is still Text Document.

Type is still Text Document

Then you may need to confirm that the actual extension is not hidden on the folder level.

actual extension is not hidden

Once you can see the actual extension you can remove the .txt to make it .vbs

enter image description here

enter image description here

enter image description here

Upvotes: 0

James Forbes
James Forbes

Reputation: 1497

When you save the file in the drop down list "Save As Type" select "All Files (.)"

Then in the "File name" make sure your file name ends with a .vbs extension.

File Dialog

If all else fails, you can also enable file extensions in windows explorer and manually edit the filename within the folder.

Upvotes: 6

bill
bill

Reputation: 9

You use quotes not brackets. You have file extensions hidden hence this behaviour.

Upvotes: 0

Related Questions