FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Open a network folder
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Open a network folder
Posted: Mon Nov 11, 2024 10:51 AM

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?

Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Open a network folder
Posted: Mon Nov 11, 2024 01:14 PM
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/26831-abrir-o-explorer-di-windows-j%C3%A1-na-pasta/

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Open a network folder
Posted: Mon Nov 11, 2024 01:52 PM

No, that's not it.

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Open a network folder
Posted: Mon Nov 11, 2024 07:51 PM
ShellExecute() doesn't seem to work over the network :(
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Open a network folder
Posted: Tue Nov 12, 2024 11:12 AM

Try :

HTMLVIEW("192.168.1.111")

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Open a network folder
Posted: Tue Nov 12, 2024 12:02 PM
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
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Open a network folder
Posted: Tue Nov 12, 2024 01:24 PM
Natter, see if this example helps. Your question is very confusing.

Natter, vea si este ejemplo ayuda. Tu pregunta es muy confusa.
Code (fw): Select all Collapse
// 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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 257
Joined: Mon Jun 10, 2013 06:40 PM
Re: Open a network folder
Posted: Tue Nov 12, 2024 05:59 PM

A mi me funciona:

ShellExecute(0,"Open","\192.168.16.237\Win\WinAA\admin.exe","1",,3)

Saludos.

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Open a network folder
Posted: Tue Nov 12, 2024 06:39 PM

Thank you. I did everything through the CMDKEY command. Works fine

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Open a network folder
Posted: Thu Nov 14, 2024 11:16 AM
From CMD, this command is executed perfectly.
Code (fw): Select all Collapse
cmdkey /add:\\MyIP\folder\ /user:UserName /pass:"123"
Is it possible to execute it from FW ?
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Open a network folder
Posted: Thu Nov 14, 2024 06:05 PM

WaitRun( 'cmdkey /add:\MyIP\folder\ /user:UserName /pass:"123"' )

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion