0

Having sort of issue that is more likely annoying when need to create short batch script (though it's not scripting issue).

I want to right-click on desktop and create new text file. Rename it and make it's extension as .bat (or .cmd). Since this point I am no longer able to right-click the file and click on EDIT, nor PRINT and neither OPEN with one common error: The parameter is incorrect.

I can edit the file by starting notepad and opening the file manually via notepad. I can run notepad myscript.bat without any issues as well If I will edit the file and just put anything inside (basically to make it not 0b file size), then I am able to edit the file from explorer (right-click > edit)

Seems it does not matter how the file is created. Tried:

  • Created the file from explorer (like mentioned above)
  • Created the file by starting notepad and saving it as (empty) .bat file
  • Created the file by type nul > myscript.bat
  • Created the file by copy myfile.txt myscript.bat (file was empty - 0b size)

Basically no matter how the file is created, as long as it is empty (having 0b size), it cannot be opened/edited/printed from explorer directly

I am running Windows Server 2012 R2, but encountered same behavior on Windows Server 2008 as well.

As mentioned. It is not really any huge issue, but is kinda annoying.

Have anyone encountered such behavior? Any assistance appreciated

EDIT:
Same behavior is also with .reg files

EDIT:
I have found an workaround for this annoying issue. In registry path HKEY_CLASSES_ROOT\.txt\ShellNew I've created new String Value named Data with (space) as data of this string.
As an result, every single .txt file created will automatically contain single space, hence the size won't be 0b anymore and file can be edited once renamed to .bat, .cmd or .reg.
Though still not a real solution for this. Still looking for real solution. If anyone knows please let me know

R1cky
  • 363
  • 1
  • 2
  • 10

0 Answers0