>>Somewhere here there is
>Oh, this is very, very useful for me [sarcasm inferred]
It was meant to be useful - without doing it for you. That's what "Search" is for. try "shortcut" as a search term.
Announcement
Collapse
No announcement yet.
Obtain special folder - How?
Collapse
X
-
Originally posted by Michael Mattias View PostShGetFolderPath (use CSIDL_DESKTOP and/or CSIDL_STARTUP) will give you folder names.
Shortcuts are *.lnk files.
Somewhere here there is
Knock yourself out.
Leave a comment:
-
Originally posted by Gary Beene View PostHere's some information, plus a compilable example on getting folder names.
Leave a comment:
-
Originally posted by Herman Kieskamp View PostHi Alex,
Check out this simpler version:
Leave a comment:
-
Originally posted by Michael Mattias View PostI don't suppose you'd care that willy-nilly deleting program files is a good way to end up with a bunch of "orphan'' DLLs and registry entries, would you?
If you are looking for an analogy close to home....... it's kind of like all the orphaned republics of the former USSR. The links to Moscow got servered and sure enough, you can't control anything anymore.
What about my native Moscow, Michael, let's stay off politic here. Although, if you are familiar in Russian, welcome to http://av.cemi.rssi.ru.
Leave a comment:
-
Here's some information, plus a compilable example on getting folder names. What you do when you get there, is up to you - practice safe deleting!
Code:Special Folders 'Windows API can identify folders set aside for special purposes 'Primary Code: Dim strPath As Asciiz * %MAX_PATH SHGetFolderPath(0, %CSIDL_DESKTOPDIRECTORY, 0, 0, strPath) 'Here are a few of the equates to retrieve the corresponding directory: 'See the Win32API.INC file for addiitional equates. '%CSIDL_DESKTOPDIRECTORY DeskTop '%CSIDL_PROGRAM_FILES Program Files '%CSIDL_SYSTEM System folder '%CSIDL_WINDOWS Windows directory '%CSIDL_DESKTOP <desktop> '%CSIDL_PROGRAMS Start Menu\Programs '%CSIDL_PERSONAL My Documents '%CSIDL_STARTUP Start Menu\Programs\Startup 'Compilable Example: #Compile Exe #Dim All #Include "Win32API.inc" Global hDlg As Dword Function PBMain() As Long Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlg Control Add Button, hDlg, 100,"Push", 50,10,100,20 Dialog Show Modal hDlg Call DlgProc End Function CallBack Function DlgProc() As Long If CB.Msg = %WM_Command AND CB.Ctl = 100 AND CB.Ctlmsg = %BN_Clicked Then Local sPath As Asciiz * %MAX_PATH, temp$ SHGetFolderPath(0, %CSIDL_DeskTopDirectory, 0, 0, sPath) : temp$ = temp$ + sPath + $crlf SHGetFolderPath(0, %CSIDL_Program_Files, 0, 0, sPath) : temp$ = temp$ + sPath + $crlf SHGetFolderPath(0, %CSIDL_System, 0, 0, sPath) : temp$ = temp$ + sPath + $crlf SHGetFolderPath(0, %CSIDL_Windows, 0, 0, sPath) : temp$ = temp$ + sPath + $crlf SHGetFolderPath(0, %CSIDL_DeskTop, 0, 0, sPath) : temp$ = temp$ + sPath + $crlf SHGetFolderPath(0, %CSIDL_Programs, 0, 0, sPath) : temp$ = temp$ + sPath + $crlf SHGetFolderPath(0, %CSIDL_Personal, 0, 0, sPath) : temp$ = temp$ + sPath + $crlf SHGetFolderPath(0, %CSIDL_Startup, 0, 0, sPath) : temp$ = temp$ + sPath + $crlf SHGetFolderPath(0, %CSIDL_Startup, 0, 0, sPath) : temp$ = temp$ + sPath + $crlf MsgBox temp$ End If End Function
Leave a comment:
-
Hi Alex,
Check out this simpler version:
MCM: your example is more a bit one-way example; russia->orphans oke(smart guy will recover from uninstall.log or replace deleted link), orphans->Russia no-go (roadsigns chopped down(shortcut deleted).
Leave a comment:
-
I don't suppose you'd care that willy-nilly deleting program files is a good way to end up with a bunch of "orphan'' DLLs and registry entries, would you?
If you are looking for an analogy close to home....... it's kind of like all the orphaned republics of the former USSR. The links to Moscow got servered and sure enough, you can't control anything anymore.
MCM
Leave a comment:
-
ShGetFolderPath (use CSIDL_DESKTOP and/or CSIDL_STARTUP) will give you folder names.
Shortcuts are *.lnk files. Somewhere here there is code to resolve shortcut files to the associated executable program file name.
Knock yourself out.
MCMLast edited by Michael Mattias; 4 Aug 2009, 01:44 PM.
Leave a comment:
-
Obtain special folder - How?
"Create... create..."But what must I do to obtain any special folder and DELETE part of it?
For example, I want obtain the Desktop, find all shortcuts to any progname, such as "C:\BlaBla\prog.exe /par1 ...", and delete.
Then, obtain the Startup folder, find all links to that progname, and delete.
I saw pbcc code example shown in http://www.powerbasic.com/support/pb...ad.php?t=23057 but, in first, there is hard mistake there (the construction IF p$<>" THEN is incorrect, doublequater need be shown as CHR$(34)). And in second, since 2001 there are many changes in win32api.inc.
I'm not guru enough with CoCreateInstance etc, maybe somebody solves such problem?
Regards, Alex Trenty
P.S. Sorry, I forgot to say about the platform. The result must work on 98SE/Me/2k/XP.Tags: None
Leave a comment: