Open a network folder

Post Reply
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Open a network folder

Post 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?
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: Open a network folder

Post 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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Re: Open a network folder

Post by Natter »

No, that's not it.
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Re: Open a network folder

Post by Natter »

ShellExecute() doesn't seem to work over the network :(
User avatar
Marc Venken
Posts: 1481
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Open a network folder

Post by Marc Venken »

Try :

HTMLVIEW("192.168.1.111")
Marc Venken
Using: FWH 23.08 with Harbour
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Re: Open a network folder

Post 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
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: Open a network folder

Post 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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
VitalJavier
Posts: 242
Joined: Mon Jun 10, 2013 6:40 pm

Re: Open a network folder

Post by VitalJavier »

A mi me funciona:

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

Saludos.
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Re: Open a network folder

Post by Natter »

Thank you. I did everything through the CMDKEY command. Works fine
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Re: Open a network folder

Post by Natter »

From CMD, this command is executed perfectly.

Code: Select all | Expand

cmdkey /add:\\MyIP\folder\ /user:UserName /pass:"123"
Is it possible to execute it from FW ?
User avatar
Antonio Linares
Site Admin
Posts: 42259
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Open a network folder

Post by Antonio Linares »

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

Antonio Linares
www.fivetechsoft.com
Post Reply