Solved

SHARING A FOLDER VIA CODE

Posted on 2002-06-07
21
225 Views
Last Modified: 2010-05-02
Hi all.

Somehow a client for security reasons got to a point that sometimes he needs to share a folder from W98, take a file from other computer and stop sharing it.

how can i share a folder via code from w98?

it can be from vb, from an OCX, from a DOS command, batch files, whatever, but it must be via code.  totally with out user intervention.

can it be done?
0
Comment
Question by:olx
  • 10
  • 4
  • 2
  • +4
21 Comments
 
LVL 26

Expert Comment

by:EDDYKT
Comment Utility
0
 
LVL 5

Expert Comment

by:kcm76
Comment Utility
listening...
0
 
LVL 1

Author Comment

by:olx
Comment Utility
EDDYKT

looks good, but at the time i run the sample, it returns the error
"RUN TIME ERROR 453
CANT FIND ENTRY POINT NETSHAREADD IN C:\WINDOWS\SYSTEM\NETAPI32.DLL"

the netapi32.dll version is 4.10.1998
im using w98 and wnt4

what could be wrong?
0
 
LVL 1

Author Comment

by:olx
Comment Utility

the error occurs at the last line of the addshare function

'here it breaks
p_lngRtn = NetShareAdd(servername:=p_abytServerName(0), level:=ShareLevel2, Buffer:=p_lngPtrToType, parm_err:=p_lngParmErr)
End Function
0
 
LVL 1

Expert Comment

by:barendb
Comment Utility
Try shelling to the NET command in command prompt

net share sharename=drive:path

and to stop sharing

net share sharename /D
0
 
LVL 5

Expert Comment

by:kcm76
Comment Utility
0
 
LVL 1

Author Comment

by:olx
Comment Utility
barendb:
have you actually tried what you say?

kcm76
ill look at it now.
:)
0
 
LVL 1

Author Comment

by:olx
Comment Utility
barendb:
have you actually tried what you say?

kcm76
ill look at it now.
:)
0
 
LVL 1

Author Comment

by:olx
Comment Utility
KCM76:
it is the same situation with EDDYKT, it does not seem to work with 9x

i've tried the changes in the declaration and it seems the author has not tried his samples.

:(
0
 
LVL 1

Author Comment

by:olx
Comment Utility

it works great in NT but i need to doit in 9x

Yiaks!!!!
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Expert Comment

by:barendb
Comment Utility
Yes, and it works perfectly, unless you specify an invalid path.
0
 
LVL 1

Author Comment

by:olx
Comment Utility
barendb:

In what windows version that is?
in windows 98 it goes like this...

C:\WINDOWS\Desktop>md x

C:\WINDOWS\Desktop>net share sharename=c:\windows\desktop\x
The command SHARE is unknown. For a list of valid commands, type NET HELP at the command prompt.
For help, type NET /? at the command prompt.

C:\WINDOWS\Desktop>

there is no SHARE option available in the NET program.
What windows version are u running?

0
 
LVL 1

Expert Comment

by:barendb
Comment Utility
I'm running 2000 on my work PC where I am at the moment and 98 on my home PC,  the syntax for the command might be a bit different but shouldn't be.  when you type net help, which commands do you have available, because I've definitely done on this on 95 & 98.

On other thought, is 'File and Printer sharing' installed under your network options, if not, there is no way that any of the solutions given here will possibly work.

Regards
Barend
0
 
LVL 1

Author Comment

by:olx
Comment Utility
Barendb:

Of course file and printer sharing are enabled.

if you have done it in w98 then 200 points are waiting for you.

in w98 the net command has no documented SHARE option.

net syntax ------------
For more information about a specific Microsoft NET
command, type the command name followed by /?
(for example, NET VIEW /?).

NET CONFIG   Displays your current workgroup settings.
NET DIAG     Runs the Microsoft Network Diagnostics
             program to display diagnostic information
             about your network.
NET HELP     Provides information about commands and
             error messages.
NET INIT     Loads protocol and network-adapter drivers
 without
             binding them to Protocol Manager.  
NET LOGOFF   Breaks the connection between your computer and
             the shared resources to which it is connected.
NET LOGON    Identifies you as a member of a workgroup.
NET PASSWORD Changes your logon password.
NET PRINT    Displays information about print queues
             and controls print jobs.
NET START    Starts services.
NET STOP     Stops services.
NET TIME     Displays the time on or synchronizes your computer's
             clock with the clock on a Microsoft Windows for
             Workgroups, Windows NT, Windows 95, or NetWare time server.
NET USE      Connects to or disconnects from a shared
             resource or displays information about
             connections.
NET VER      Displays the type and version number of the
             workgroup redirector you are using.
NET VIEW     Displays a list of computers that share
             resources or a list of shared resources
             on a specific computer.


Windows 98 [Version 4.10.2222]

0
 
LVL 1

Author Comment

by:olx
Comment Utility
i guess ill get doing other things instead of creating a share, because the target user there is no way to move him from w98.

:(
0
 
LVL 1

Expert Comment

by:barendb
Comment Utility
I'll have a look again.
0
 
LVL 1

Author Comment

by:olx
Comment Utility
anyone?

i think i will delete this question.
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
Hi olx,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Refund points and save as a 0-pt PAQ.

olx, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:jeenux
Comment Utility
Hi there,

I may have a solution for this question. My code is done but I need to test it tomorrow at work because I don't have Win98 at home. So you should expect an answer by tomorrow night (Feb 11 2003) at around 8:00 PM EST.

See you tomorrow,

Jeenux
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
Comment Utility
Since this thread is over 6 months old and any solution presented may be well overdue, I am PAQ'ing and refunding this question as recommended.  However, if the solution provided by jeenux is valid and olx responds, I can isue a "points for jeenux" question for the full 200 points.

SpideyMod
Community Support Moderator @Experts Exchange
0
 
LVL 1

Expert Comment

by:jeenux
Comment Utility
Hi olx !

I made a VB prog for another post to share a folder in Windows 98. I didn't have time to finalize share passwords but if you need it I can do it. The program works from command-line or from VB. You type something like this from the command-line:

SHARE98.EXE \\<COMPUTER_NAME> <LOCAL_PATH> <SHARE_NAME> "<SHARE_DESC>"

Ex: SHARE98.EXE \\LOCALHOST C:\Windows Windows "Windows directory"

Here's the link to the program (I also included the source code).

http://pages.infinit.net/jeenux/ShareWin98.zip

It's really alpha so if you have any problems with it just tell me ;)

Have a nice evening !

Jeenux
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now