0

So I have this problem for a little problem right now. I write a simple .vbs script,

x=msgbox("test",18,"test")

which is total perfect, right? Now everytime I try to save this file like following

It's Dutch for a save as .txt file, but as extension .vbs.
Now I'm curious how stupid I am, or how I'm going to fix this.

jotik
  • 17,044
  • 13
  • 58
  • 123
  • 1
    Enclose the name in quotes to override automatic extension appending. `"filename.vbs"`. This occurs when explorer's view setting is to hide extensions (the default - but most advanced users change it). –  Apr 21 '16 at 21:26
  • saving it as "test.vbs" and select All Files (*.*) in dropdown – Ahsan Aziz Abbasi Jan 26 '17 at 12:23

2 Answers2

1

Essentially, it is saving it as "test.vbs.txt".

Click the "Save as type" (Opslaan als) dropdown box and select All Files (*.*) (alle dateien?). After that it should save as "test.vbs" as you expect.

-1

It's saving it as a .txt file because the dialog is set to save with that type. You can either select All Files (*.*) from the dropdown or you can surround the file name in quotes to save it exactly as shown.

Nilpo
  • 4,675
  • 1
  • 25
  • 39
  • I tried this but it didn't work. It showed up like the notepad from windows 7 (if I'm right) http://prntscr.com/avduxq Now that's a printscreen of a normal .txt file, and a .vbs file. – Jeroen Steens Apr 22 '16 at 10:27
  • Thay may be fine. It depends whether you have a file type handler registered or not. What happens when you double click it? What file type does it say if you right-click and choose `Properties...`? – Nilpo Apr 22 '16 at 20:16
  • I got it! I entered properties and it said "open with notepad" so I changed that to "Microsoft Windows based script host" or something and now I get the right icon and everything works! – Jeroen Steens Apr 23 '16 at 06:39
  • @JeroenSteens There you go! Those file type handlers can cause some unpredictable behavior when they inadvertently get changed from their defaults. – Nilpo Apr 23 '16 at 06:41