0

I've associated batch files with Notepad++ on my work Windows 7 machine, but I need to execute some scripts when I log on (which I'm attempting to do via the Local Group Policy Editor).

Instead of executing the specified script, Windows simply opens the batch files with Notepad++.

Is there an automated way to execute these files when I log on, WITHOUT removing the file association with Notepad++?

Ƭᴇcʜιᴇ007
  • 111,883
  • 19
  • 201
  • 268
Toby Wilson
  • 113
  • 4

2 Answers2

2

You told the OS to open batch files with Notepad, it's doing so. This is how Windows works.

You'll need to change the association back to what it should be for the login scripting to run.

Some alternative ways to open batch files in Notepad++:

  1. Right-click the Batch file and select Edit in Notepad++.
  2. Open Notepad++ and drag the batch file you want to edit onto it.
  3. Open Notepad++ and use File -> Open.
  4. Create a shortcut to Notepad++ someplace accessible, and drag the batch file onto the shortcut.
Ƭᴇcʜιᴇ007
  • 111,883
  • 19
  • 201
  • 268
  • I thought I'd told the OS to associate opening files via the default explorer with a certain program; but I guess that's another reason why I prefer Linux. – Toby Wilson Jan 11 '17 at 16:20
  • File associations are at the OS level, not a the shell (Explorer) level. If you kill Explorer, and then launch a batch file via Run Task in the Task Manger (for example) , it'll still use the same program you've associated it. Hope that clears that up a little. PS: While I'm glad you like Linux, to put it bluntly, we don't care, as it has nothing to do with the problem at hand. And mentioning it for no reason makes you look like a fanboy. – Ƭᴇcʜιᴇ007 Jan 11 '17 at 16:35
2

If you change xyz.bat to xyz.cmd then double clicking it will run it normally. If you change your startup bat files to cmd files it should work.

(I haven't tested it. I do what Techie007 suggested.)

simon at rcl
  • 221
  • 1
  • 6