when open text file using notepad, shortcut file created in recent folder. how notepad internally. tried open text file using
process.start("c:\test.txt");
but no shortcut created. other files, image, video , audio, recent file shortcuts being created. using
process.start("c:\summer.jpeg");
i tried using commands below.
processstartinfo psi = new processstartinfo(); psi.windowstyle = processwindowstyle.hidden; psi.useshellexecute = true; psi.workingdirectory = environment.getfolderpath(environment.specialfolder.system); psi.filename = system.io.path.combine(environment.getfolderpath(environment.specialfolder.system), "notepad.exe"); psi.arguments = "c:\test.txt"; process.start(psi);
you can try use function shaddtorecentdocs
add file recent list.
https://msdn.microsoft.com/en-us/library/windows/desktop/bb762105(v=vs.85).aspx
here find c# invoke:
http://www.pinvoke.net/default.aspx/shell32.shaddtorecentdocs
Comments
Post a Comment