Page 1 of 1

type file dont change??

Posted: 25 Jan 2022 14:30
by nigromante
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 5100 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.

Re: type file dont change??

Posted: 26 Jan 2022 08:19
by Squashman
Were you doing this from the command line or a batch file?

Re: type file dont change??

Posted: 26 Jan 2022 10:23
by nigromante
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.

Re: type file dont change??

Posted: 26 Jan 2022 12:49
by atfon
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"

Re: type file dont change??

Posted: 26 Jan 2022 14:06
by nigromante
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......

Re: type file dont change??

Posted: 26 Jan 2022 14:13
by atfon
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.