Page 1 of 1
Open a network folder
Posted: Mon Nov 11, 2024 10:51 am
by Natter
I need to navigate to the folder by IP address. To do this, I enter \\IP\myfolder into the address bar of the explorer and press Enter.
Next, the standard "Safety Windows" window opens, offering to enter Login and Password.
I tried to do this via ShellExecute(, 'Open', 'Explorer.exe ', '\\'+IP+'\myfolder',,3), however, nothing happened. What am I wrong about?
Re: Open a network folder
Posted: Mon Nov 11, 2024 1:14 pm
by karinha
Good morning. See if it helps. use google translate, pls.
Buen día. Vea si ayuda. Utilice el traductor de Google, por favor.
https://fivewin.com.br/index.php?/topic ... -na-pasta/
Regards, saludos.
Re: Open a network folder
Posted: Mon Nov 11, 2024 1:52 pm
by Natter
No, that's not it.
Re: Open a network folder
Posted: Mon Nov 11, 2024 7:51 pm
by Natter
ShellExecute() doesn't seem to work over the network
Re: Open a network folder
Posted: Tue Nov 12, 2024 11:12 am
by Marc Venken
Try :
HTMLVIEW("192.168.1.111")
Re: Open a network folder
Posted: Tue Nov 12, 2024 12:02 pm
by Natter
How will HTML VIEW() help me in this case ? The computer is on the local network, but not in the domain.
I need to open a network folder on another computer. I tried to do this through cmdkey and through net use. It hasn't worked out yet
Re: Open a network folder
Posted: Tue Nov 12, 2024 1:24 pm
by karinha
Natter, see if this example helps. Your question is very confusing.
Natter, vea si este ejemplo ayuda. Tu pregunta es muy confusa.
Code: Select all | Expand
// C:\FWH\SAMPLES\ABRIRPAS.PRG
#include "FiveWin.ch"
STATIC oWnd
FUNCTION Main()
LOCAL oIco, oBar, oBmp
SetBalloon( .T. )
SkinButtons()
DEFINE ICON oIco FILE "..\icons\fax.ico"
DEFINE WINDOW oWnd FROM 1, 5 TO 20, 70 TITLE "Abrir Pastas/Open Folders" ;
MENU BuildMenu() COLOR "B/W" ICON oIco
DEFINE BUTTONBAR oBar _3D SIZE 60, 40 OF oWnd 2007
WITH OBJECT oBar
oBar:nClrText := CLR_HBLUE
oBar:Adjust()
END
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\Open.bmp" ;
PROMPT "Windows" ;
ACTION AbrePasta( GetWinDir() ) ;
TOOLTIP "Abrir a pasta do Windows" NOBORDER GROUP
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\floppy.bmp" ;
PROMPT "System" ;
ACTION AbrePasta( GetSysDir() ) ;
TOOLTIP "Abrir a pasta do sistema" NOBORDER GROUP
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\new.bmp" ;
PROMPT "Select" ;
ACTION AbrePasta( cGetDir() ) ;
TOOLTIP "Abrir uma pasta qualquer do sistema" NOBORDER GROUP
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\Help.bmp" ;
PROMPT "Source" ;
ACTION AbrePasta( "c:\" ) ;
TOOLTIP "Abrir a pasta C:\" NOBORDER GROUP
DEFINE BUTTON OF oBar FILENAME "..\bitmaps\16x16\Exit.bmp" FLAT ;
ACTION( oWnd:End() ) TOOLTIP "Exit this app" GROUP
SET MESSAGE OF oWnd TO "Abrir pastas/Open Folders" 2007
DEFINE BITMAP oBmp FILENAME "..\bitmaps\visual.bmp"
oWnd:bPainted = {| hDC | BmpTiled( hDC, oWnd, oBmp ) }
ACTIVATE WINDOW oWnd CENTERED
RETURN NIL
FUNCTION BuildMenu()
LOCAL oMenu
MENU oMenu
MENUITEM "Abrir/Open"
MENU
MENUITEM "Pasta do Windows";
ACTION AbrePasta( GetWinDir() ) ;
MESSAGE "Abrir a pasta do Windows"
SEPARATOR
MENUITEM "Pasta de Sistema" ;
ACTION AbrePasta( GetSysDir() ) ;
MESSAGE "Abrir a pasta do sistema"
SEPARATOR
MENUITEM "Pasta selecionada" ;
ACTION AbrePasta( cGetDir() ) ;
MESSAGE "Abrir a pasta uma pasta qualquer"
SEPARATOR
MENUITEM "Unidade C:\ (Raiz)" ;
ACTION AbrePasta( "c:\" ) ;
MESSAGE "Abrir a pasta c:\"
SEPARATOR
MENUITEM "Sair" ;
ACTION oWnd:End() ;
MESSAGE "Finaliza a aplicação"
ENDMENU
ENDMENU
RETURN( oMenu )
FUNCTION AbrePasta( cPath )
LOCAL hFile
LOCAL cCmd := "start " + cPath, cBat := ".\abrir.bat"
IF ( hFile := FCreate( cBat ) ) != -1
FWrite( hFile, cCmd )
FClose( hFile )
MsgRun( "Executando...", "Executando...", {|| Winexec( cBat, 0 ) } )
ENDIF
RETURN NIL
STATIC FUNCTION BmpTiled( hDC, oWnd, oBmp )
LOCAL nWidth := oWnd:nWidth(), nHeight := oWnd:nHeight()
LOCAL nRow := 0, nCol := 0 // , n
LOCAL nBmpWidth := oBmp:nWidth(), nBmpHeight := oBmp:nHeight()
IF oBmp:hBitmap == 0
RETURN NIL
ENDIF
WHILE nRow < nHeight
nCol = 0
WHILE nCol < nWidth
PalBmpDraw( hDC, nRow, nCol, oBmp:hBitmap )
nCol += nBmpWidth
END
nRow += nBmpHeight
END
RETURN NIL
// FIN / END - kapiabafwh@gmail.com
Regards, saludos.
Re: Open a network folder
Posted: Tue Nov 12, 2024 5:59 pm
by VitalJavier
A mi me funciona:
ShellExecute(0,"Open","\\192.168.16.237\Win\WinAA\admin.exe","1",,3)
Saludos.
Re: Open a network folder
Posted: Tue Nov 12, 2024 6:39 pm
by Natter
Thank you. I did everything through the CMDKEY command. Works fine
Re: Open a network folder
Posted: Thu Nov 14, 2024 11:16 am
by Natter
From CMD, this command is executed perfectly.
Is it possible to execute it from FW ?
Re: Open a network folder
Posted: Thu Nov 14, 2024 6:05 pm
by Antonio Linares
WaitRun( 'cmdkey /add:\\MyIP\folder\ /user:UserName /pass:"123"' )