topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 10:14 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: create a new entry in the main contextual menu : a new txt file  (Read 22518 times)

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: create a new entry in the main contextual menu : a new txt file
« Reply #25 on: February 23, 2014, 08:26 AM »
have you tried running this command via a batch file? fsutil file [createnew]

https://www.microsof...cs/en-us/fsutil.mspx
Running to try inmediately.
Best Regards
 :-*

Seems a very powerful tool.
Have you tried really ?
I don't the command and is for windows 7-64

Best Regards

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: create a new entry in the main contextual menu : a new txt file
« Reply #26 on: February 23, 2014, 08:27 AM »
Ok.  I already had Text File in New menu.  Here's what I did to get a template file.

This key
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.txt\ShellNew

I added a new string named FileName and for value Template.txt


In the folder C:\Windows\ShellNew I made a file named Template.txt.  The contents is:
This is a text file template.

Now if I right click the desktop or in a folder, select New text document, name it, then double click, it has the text from the template.

One thing I notice I can't do it directly under C:\

It has to be in a folder.  The permissions situation with W8 seems even worse than W7 now.  Every move is hamstrung. I can't even save a file from Editpad directly into C:\Windows\ShellNew.  I have to save it somewhere else, then drag it.  Really asinine.

Anyway, I hope the template text default was what you were interested in.  If not then, Never Mind.  :)

Seems easy for me. Running to try and will comment.

Best Regards

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: create a new entry in the main contextual menu : a new txt file
« Reply #27 on: February 23, 2014, 08:29 AM »
Miles only hopes is a new entry in the main contextual menu, not in the new submenu of the main contextual menu......

 :-[

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: create a new entry in the main contextual menu : a new txt file
« Reply #28 on: February 23, 2014, 08:31 AM »
Really asinine

I prefer to wait to you. Seems an annoying solution by your words. And not for the main contextual menu.
 :-[

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: create a new entry in the main contextual menu : a new txt file
« Reply #29 on: February 23, 2014, 08:49 AM »
Ok.  Let me get it straight.  You right click an empty space on desktop or folder and the command is in the menu?  Or you right click on a file and the command is there?  It would seem more logical to do the former if making new files.

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: create a new entry in the main contextual menu : a new txt file
« Reply #30 on: February 23, 2014, 08:58 AM »
Ok.  Let me get it straight.  You right click an empty space on desktop or folder and the command is in the menu?  Or you right click on a file and the command is there?  It would seem more logical to do the former if making new files.

Yes, the former Miles.
Create a new txt file just clicking right in an empty space of the desktop or any windows explorer folder .
 :-*

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: create a new entry in the main contextual menu : a new txt file
« Reply #31 on: February 23, 2014, 09:00 AM »
Ok.  After the text file is created do you want to open it in an editor or just double click to open?

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: create a new entry in the main contextual menu : a new txt file
« Reply #32 on: February 23, 2014, 09:04 AM »
Ok.  After the text file is created do you want to open it in an editor or just double click to open?

Just double click to open. the same behaviour like in the "new" secondary contextual menu.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: create a new entry in the main contextual menu : a new txt file
« Reply #33 on: February 23, 2014, 11:36 AM »
This ahk should do it.

Sendmode,input
Click,Right
Send,w
Sleep,200
Send,t

Compile it to exe.. maybe NewTextFile.exe.
In RegEdit go to
HKEY_CLASSES_ROOT\Directory\shell
create a key
New Text File
under that create a key
command

for default value put path to NewTextFile.exe
example C:\Utils\NewTextFile.exe

Since there is no window it should not block the mouse.  It's just a macro to right click to open menu, then sends 'w' and then 't'  the system does the rest.  It's just opening the New submenu.

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: create a new entry in the main contextual menu : a new txt file
« Reply #34 on: February 23, 2014, 01:06 PM »
This ahk should do it.

Sendmode,input
Click,Right
Send,w
Sleep,200
Send,t

Compile it to exe.. maybe NewTextFile.exe.
In RegEdit go to
HKEY_CLASSES_ROOT\Directory\shell
create a key
New Text File
under that create a key
command

for default value put path to NewTextFile.exe
example C:\Utils\NewTextFile.exe

Since there is no window it should not block the mouse.  It's just a macro to right click to open menu, then sends 'w' and then 't'  the system does the rest.  It's just opening the New submenu.

I don't understand all the concept, but I will try and comment.
Best Regards
 :-*

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: create a new entry in the main contextual menu : a new txt file
« Reply #35 on: February 23, 2014, 01:15 PM »
Ejem. The concept is clear after analyze. Applying
 :-[ :tellme:

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: create a new entry in the main contextual menu : a new txt file
« Reply #36 on: February 23, 2014, 04:36 PM »
Ejem. The concept is clear after analyze. Applying
 :-[ :tellme:

You don't have to go the macro route.  But I figured the mechanism is there and you don't have to mess with temp filename stuff.  Plus newer versions of Windows are finicky about creating files.  You could use a program that just calls CreateFile() but it may need to be run as administrator.

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: create a new entry in the main contextual menu : a new txt file
« Reply #37 on: February 23, 2014, 04:43 PM »
Applied.
Nothing happen after multiple proofs.

I will revise everything trying to determine what i am doing bad

the code i use :

Code: Autohotkey [Select]
  1. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. #Warn  ; Recommended for catching common errors.
  3. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  4. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  5. Click,Right
  6. Sleep,200

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: create a new entry in the main contextual menu : a new txt file
« Reply #38 on: February 23, 2014, 04:46 PM »
Ejem. The concept is clear after analyze. Applying
 :-[ :tellme:

You don't have to go the macro route.  But I figured the mechanism is there and you don't have to mess with temp filename stuff.  Plus newer versions of Windows are finicky about creating files.  You could use a program that just calls CreateFile() but it may need to be run as administrator.

I have several utilities to generate one or more empty txt files in a folder. so the purpose now is create with the contextual menu. But I think you are right. Is only create a new empty txt file with an entry in the main contextual menu.

How can i do that ?
Or what am i doing bad in the prior script ?

Best Regards
 :-*

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: create a new entry in the main contextual menu : a new txt file
« Reply #39 on: February 23, 2014, 04:48 PM »
By the way i have initial problems with compilers.

One of my compilers don't go well.
Where is the official version of Autohotkey_L ?

Best Regards

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,566
    • View Profile
    • Donate to Member
Re: create a new entry in the main contextual menu : a new txt file
« Reply #40 on: February 23, 2014, 05:00 PM »
Lexikos / AutoHotkey_L
Continuation of Chris Mallett's AutoHotkey, by Lexikos. https://github.com/Lexikos
Don't know where to start or how to fix your script? Join the friendly AutoHotkey community and ask for help.

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: create a new entry in the main contextual menu : a new txt file
« Reply #41 on: February 23, 2014, 05:15 PM »
Lexikos / AutoHotkey_L
Continuation of Chris Mallett's AutoHotkey, by Lexikos. https://github.com/Lexikos
Don't know where to start or how to fix your script? Join the friendly AutoHotkey community and ask for help.

Thanks Curt

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: create a new entry in the main contextual menu : a new txt file
« Reply #42 on: February 23, 2014, 05:25 PM »
First time i tried this : Compile_AHK.exe
Now I know the official version is ahk2exe.exe

Best Regards
I also has in the contextual menu working well.
 :-*

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: create a new entry in the main contextual menu : a new txt file
« Reply #43 on: February 23, 2014, 07:49 PM »
Seems a very powerful tool.
Have you tried really ?
I don't the command and is for windows 7-64

no idea why 'you don't the command'.. it works here in win 7 64-bit..

FSUTIL:


context menu:

Contro

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 3,940
    • View Profile
    • Donate to Member
Re: create a new entry in the main contextual menu : a new txt file
« Reply #44 on: February 23, 2014, 08:13 PM »
Seems a very powerful tool.
Have you tried really ?
I don't the command and is for windows 7-64

no idea why 'you don't the command'.. it works here in win 7 64-bit..

FSUTIL:


context menu:


sorry. I don't know how to do that screenshot with fsutil.  :-[
What command and parameters do you use exactly ?
Best regards