Open a network folder

Open a network folder

Postby Natter » 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?
Natter
 
Posts: 1218
Joined: Mon May 14, 2007 9:49 am

Re: Open a network folder

Postby karinha » Mon Nov 11, 2024 1: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
User avatar
karinha
 
Posts: 7818
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Open a network folder

Postby Natter » Mon Nov 11, 2024 1:52 pm

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

Re: Open a network folder

Postby Natter » Mon Nov 11, 2024 7:51 pm

ShellExecute() doesn't seem to work over the network :(
Natter
 
Posts: 1218
Joined: Mon May 14, 2007 9:49 am

Re: Open a network folder

Postby Marc Venken » Tue Nov 12, 2024 11:12 am

Try :

HTMLVIEW("192.168.1.111")
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1433
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Open a network folder

Postby Natter » 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
Natter
 
Posts: 1218
Joined: Mon May 14, 2007 9:49 am

Re: Open a network folder

Postby karinha » Tue Nov 12, 2024 1: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: Select all  Expand view

// 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
karinha
 
Posts: 7818
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Open a network folder

Postby VitalJavier » Tue Nov 12, 2024 5:59 pm

A mi me funciona:

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

Saludos.
User avatar
VitalJavier
 
Posts: 241
Joined: Mon Jun 10, 2013 6:40 pm

Re: Open a network folder

Postby Natter » Tue Nov 12, 2024 6:39 pm

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

Re: Open a network folder

Postby Natter » Thu Nov 14, 2024 11:16 am

From CMD, this command is executed perfectly.
Code: Select all  Expand view
cmdkey /add:\\MyIP\folder\ /user:UserName /pass:"123"

Is it possible to execute it from FW ?
Natter
 
Posts: 1218
Joined: Mon May 14, 2007 9:49 am

Re: Open a network folder

Postby Antonio Linares » Thu Nov 14, 2024 6:05 pm

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42097
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 23 guests