• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 243
  • Last Modified:

SHARING A FOLDER VIA CODE

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
olx
Asked:
olx
  • 10
  • 4
  • 2
  • +4
1 Solution
 
Chandramouli kArchitectCommented:
listening...
0
 
olxAuthor Commented:
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
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
olxAuthor Commented:

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
 
barendbCommented:
Try shelling to the NET command in command prompt

net share sharename=drive:path

and to stop sharing

net share sharename /D
0
 
Chandramouli kArchitectCommented:
0
 
olxAuthor Commented:
barendb:
have you actually tried what you say?

kcm76
ill look at it now.
:)
0
 
olxAuthor Commented:
barendb:
have you actually tried what you say?

kcm76
ill look at it now.
:)
0
 
olxAuthor Commented:
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
 
olxAuthor Commented:

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

Yiaks!!!!
0
 
barendbCommented:
Yes, and it works perfectly, unless you specify an invalid path.
0
 
olxAuthor Commented:
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
 
barendbCommented:
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
 
olxAuthor Commented:
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
 
olxAuthor Commented:
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
 
barendbCommented:
I'll have a look again.
0
 
olxAuthor Commented:
anyone?

i think i will delete this question.
0
 
DanRollinsCommented:
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
 
jeenuxCommented:
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
 
SpideyModCommented:
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
 
jeenuxCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 10
  • 4
  • 2
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now