type file dont change??

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
nigromante
Posts: 3
Joined: 25 Jan 2022 14:05

type file dont change??

#1 Post by nigromante » 25 Jan 2022 14:30

Good night.

Today I have started to study ms-dos CMD. I have started with the assoc command.

For greater understanding I tried to do this thing.

I installed notepad++ and I asociate the extension .ntop=notepadfile.

Then with the command ftype I asociated the binary file that the system have to use for open this archive.

ftype notepadfile="C:\Program Files\Notepad++\notepad.exe" "%1" "%"

I recognize I dont undertand what is %1 and % but there is no errors in the console

------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------
1.png
1.png (27.57 KiB) Viewed 5099 times
In the picture we can see the system dont recognize the extension .ntop like notepadfile
I thought it was going to be automatic and with google there are many results that have nothing to do with what I am looking for.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

I thought that the system would choose the program with which to open the file automatically. I know If I click in the change button I can select the specific program
but want to do this with commands line.

Thanks for your attention and sorry if my english is a little bad.
Last edited by nigromante on 26 Jan 2022 13:36, edited 1 time in total.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: type file dont change??

#2 Post by Squashman » 26 Jan 2022 08:19

Were you doing this from the command line or a batch file?

nigromante
Posts: 3
Joined: 25 Jan 2022 14:05

Re: type file dont change??

#3 Post by nigromante » 26 Jan 2022 10:23

by command line with cmd (run as administrator)...

Code: Select all

assoc .ntop=notepadfile
ftype notepadfile="C:\Program Files\Notepad++\notepad.exe" "%1" "%"
I thought if I create a file with the extension .ntop the system set notepad++ automatically.
Last edited by nigromante on 26 Jan 2022 13:35, edited 1 time in total.

atfon
Posts: 178
Joined: 06 Oct 2017 07:33

Re: type file dont change??

#4 Post by atfon » 26 Jan 2022 12:49

Be sure you are selecting the correct location of the notepad++.exe file. On my system at least, the path is: "C:\Program Files (x86)\Notepad++\notepad++.exe"

nigromante
Posts: 3
Joined: 25 Jan 2022 14:05

Re: type file dont change??

#5 Post by nigromante » 26 Jan 2022 14:06

Yes...It is the correct path/rute of notepad.

I make a video of 1 minute for if someone want to see it. maybe seeing what I did you can see the error I maked.

https://www.youtube.com/watch?v=POZ7tU-_m_s

Thanks......

atfon
Posts: 178
Joined: 06 Oct 2017 07:33

Re: type file dont change??

#6 Post by atfon » 26 Jan 2022 14:13

nigromante wrote:
26 Jan 2022 14:06
Yes...It is the correct path/rute of notepad.

I make a video of 1 minute for if someone want to see it. maybe seeing what I did you can see the error I maked.

https://www.youtube.com/watch?v=POZ7tU-_m_s

Thanks......
Well, I see you edited your post to correct the file path, but now you don't have the correct file name. It should be notepad++.exe and not notepad.exe, which is a Windows system file in the C:\Windows\System32 folder.

Post Reply