Solved

SHARING A FOLDER VIA CODE

Posted on 2002-06-07
21
232 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 10
  • 4
  • 2
  • +4
21 Comments
 
LVL 26

Expert Comment

by:EDDYKT
ID: 7063304
0
 
LVL 5

Expert Comment

by:kcm76
ID: 7063965
listening...
0
 
LVL 1

Author Comment

by:olx
ID: 7068365
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:olx
ID: 7068372

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
ID: 7069505
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
ID: 7069548
0
 
LVL 1

Author Comment

by:olx
ID: 7070755
barendb:
have you actually tried what you say?

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

Author Comment

by:olx
ID: 7070766
barendb:
have you actually tried what you say?

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

Author Comment

by:olx
ID: 7071006
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
ID: 7071047

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

Yiaks!!!!
0
 
LVL 1

Expert Comment

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

Author Comment

by:olx
ID: 7073228
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
ID: 7074793
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
ID: 7092923
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
ID: 7092935
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
ID: 7092979
I'll have a look again.
0
 
LVL 1

Author Comment

by:olx
ID: 7129063
anyone?

i think i will delete this question.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7873380
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
ID: 7922731
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
ID: 7924866
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
ID: 7930627
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

691 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