Solved

How to Create a folder in Win 95?

Posted on 2002-03-19
7
201 Views
Last Modified: 2010-05-02
I have problems with creating a folder in win 95 using VB.
But i did not encounter any problems in win 98 & win 2k.
i use system object to create the folder but it fails in win 95.
Can someone help me thanks ....
0
Comment
Question by:furballz
7 Comments
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 50 total points
ID: 6881773
'In general section
Private Declare Function CreateDirectory Lib "kernel32" Alias "CreateDirectoryA" (ByVal lpPathName As String, lpSecurityAttributes As SECURITY_ATTRIBUTES) As Long
Private Type SECURITY_ATTRIBUTES
    nLength As Long
    lpSecurityDescriptor As Long
    bInheritHandle As Long
End Type

Private Sub Command1_Click()
    Dim Security As SECURITY_ATTRIBUTES
    'Create a directory
    Ret& = CreateDirectory("C:\Directory", Security)
    'If CreateDirectory returns 0, the function has failed
    If Ret& = 0 Then MsgBox "Error : Couldn't create directory !", vbCritical + vbOKOnly
End Sub
 

GOOD LUCK
0
 
LVL 50

Expert Comment

by:Ryan Chong
ID: 6881827
Hi furballz,

I think this should works in win95:

mkdir "C:\myFolder"
0
 

Author Comment

by:furballz
ID: 6881847
hi ryancys

does this method work for other OS as well like win 98 , win 2k n NT?

thanks ..
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 50

Expert Comment

by:Ryan Chong
ID: 6881857
Current i'm using Win2000 professional, try this at home before which OS is Win98. This method should integrated/ works for all OS under M$ products :)
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 6894907
I've successfully used mkdir since pre-VB (Quick BASIC) and on every Win OS except XP (haven't tried it yet.)  Never had a problem...although the File System Object should also work fine unless the dll is not installed on the O/S (whereas mkdir requires not additional dll file!)
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7634177
Hi furballz,
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:

    Split points between: roshmon and ryancys

furballz, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:kodiakbear
ID: 7666041
Moving to the paq

kb
Experts Exchange Moderator
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…

810 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