473,785 Members | 2,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Equivalent of FIleSystemObjec t in C#

I am try to convert the following routine into C#

dim oFSO
set oFSO = CreateObject("S cripting.Filesy stemObject")

dim sHomePath
sHomePath = '\\server\c$\ho me\'

dim oFolder
Set oFolder = oFSO.CreateFold er(sHomePath & 'BOB')

What should I use instead of the filesystem object?

Cheers

Bob
Jul 17 '07 #1
5 18939

"Bob Miller" <so*****@micros oft.comwrote in message
news:ey******** ******@TK2MSFTN GP05.phx.gbl...
>I am try to convert the following routine into C#

dim oFSO
set oFSO = CreateObject("S cripting.Filesy stemObject")

dim sHomePath
sHomePath = '\\server\c$\ho me\'

dim oFolder
Set oFolder = oFSO.CreateFold er(sHomePath & 'BOB')

What should I use instead of the filesystem object?
I don't know if you're looking for this or what.

http://preview.tinyurl.com/2akps5


Jul 17 '07 #2
"Mr. Arnold" <MR. Ar****@Arnold.c omwrote in message
news:eQ******** ******@TK2MSFTN GP04.phx.gbl...
>
"Bob Miller" <so*****@micros oft.comwrote in message
news:ey******** ******@TK2MSFTN GP05.phx.gbl...
>>I am try to convert the following routine into C#

dim oFSO
set oFSO = CreateObject("S cripting.Filesy stemObject")

dim sHomePath
sHomePath = '\\server\c$\ho me\'

dim oFolder
Set oFolder = oFSO.CreateFold er(sHomePath & 'BOB')

What should I use instead of the filesystem object?

I don't know if you're looking for this or what.

http://preview.tinyurl.com/2akps5
I'm actually trying to do the same thing as "Active Directory Users &
Computers" does when you use the "%username% " variable in the home drive
definition of a user account.

But this article might be helpful in starting me down the right path

Cheers

Bob
Jul 17 '07 #3
Hi Bob,

The functionality you're looking for is in the System.IO namespace. To
create a directory, you can use Directory.Creat e(string path).

Regards,
Bram
"Bob Miller" <some...@micros oft.comwrote in message
news:ey******** ******@TK2MSFTN GP05.phx.gbl...
>I am try to convert the following routine into C#
dim oFSO
set oFSO = CreateObject("S cripting.Filesy stemObject")
dim sHomePath
sHomePath = '\\server\c$\ho me\'
dim oFolder
Set oFolder = oFSO.CreateFold er(sHomePath & 'BOB')
What should I use instead of the filesystem object?
I don't know if you're looking for this or what.
http://preview.tinyurl.com/2akps5

I'm actually trying to do the same thing as "Active Directory Users &
Computers" does when you use the "%username% " variable in the home drive
definition of a user account.

But this article might be helpful in starting me down the right path

Cheers

Bob

Jul 17 '07 #4
Thanks Bram

"Bram" <b.*****@gmail. comwrote in message
news:11******** **************@ z28g2000prd.goo glegroups.com.. .
Hi Bob,

The functionality you're looking for is in the System.IO namespace. To
create a directory, you can use Directory.Creat e(string path).

Regards,
Bram
"Bob Miller" <some...@micros oft.comwrote in message
news:ey******* *******@TK2MSFT NGP05.phx.gbl.. .
I am try to convert the following routine into C#
>dim oFSO
set oFSO = CreateObject("S cripting.Filesy stemObject")
>dim sHomePath
sHomePath = '\\server\c$\ho me\'
>dim oFolder
Set oFolder = oFSO.CreateFold er(sHomePath & 'BOB')
>What should I use instead of the filesystem object?
I don't know if you're looking for this or what.
>http://preview.tinyurl.com/2akps5

I'm actually trying to do the same thing as "Active Directory Users &
Computers" does when you use the "%username% " variable in the home drive
definition of a user account.

But this article might be helpful in starting me down the right path

Cheers

Bob


Jul 17 '07 #5
Now that I can add in some more permissions, I need to modify some of the
inherited permissions, but only for this directory
How do a copy the inherited permissions, and then stop inheritance (this
should let me modify the permissions)

Thanks Heaps

Bob
"Bob Miller" <so*****@micros oft.comwrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Thanks Bram

"Bram" <b.*****@gmail. comwrote in message
news:11******** **************@ z28g2000prd.goo glegroups.com.. .
>Hi Bob,

The functionality you're looking for is in the System.IO namespace. To
create a directory, you can use Directory.Creat e(string path).

Regards,
Bram
>"Bob Miller" <some...@micros oft.comwrote in message
news:ey****** ********@TK2MSF TNGP05.phx.gbl. ..
I am try to convert the following routine into C#

dim oFSO
set oFSO = CreateObject("S cripting.Filesy stemObject")

dim sHomePath
sHomePath = '\\server\c$\ho me\'

dim oFolder
Set oFolder = oFSO.CreateFold er(sHomePath & 'BOB')

What should I use instead of the filesystem object?

I don't know if you're looking for this or what.

http://preview.tinyurl.com/2akps5

I'm actually trying to do the same thing as "Active Directory Users &
Computers" does when you use the "%username% " variable in the home drive
definition of a user account.

But this article might be helpful in starting me down the right path

Cheers

Bob



Jul 18 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4065
by: John Dewbert | last post by:
*** post for FREE via your newsreader at post.newsfeed.com *** Hello, I have trouble passing a folder object (from a FileSystemObject) to a sub procedure. Consider the following code: =================================
3
2122
by: Steve | last post by:
Hi all, FileSystemObject question... I'm trying to check if files exist or not, but the files are not sitting on the same server as our Intranet. Basically we have about 5000 photos in a directory on our database server, and they must stay there. I want to use the FileSystemObject (running on our Intranet server) to check if a photo is there, if so display it, if not
6
23767
by: Sergio Otoya | last post by:
Hi all, Is there any way of copying a file using javascript, not using the Filesystemobject (ActiveX). I need this to run in Windows and MACS. Any help would be greatly appreciated. Thanks in advance. Sergio Otoya.
2
2180
by: Sean S - Perth, WA | last post by:
Hi all, If I create a FileSystemObject Object is it appropriate to reuse it to perform operations on different files/folders? Or should I create a new FileSystemObject Object for each file and folder? -- Sean.
1
4753
by: ricolee99 | last post by:
Hi There, I'm trying to convert some VB code into C#. There is a function defined in VB, GetAbsolutePathName(path) where it returns the complete path from the root of the drive for the specified path. so for ex.: Assume that the current directory is c:\temp\test:
9
3927
by: kermit | last post by:
I keep seeing that you can use the FileSystemObject in either VB script, or Javascript on an aspx page. I added a refrence to the scrrun.dll I added importing namespaces for 'System.Object', 'Scripting', 'Scripting.FileSystemObject', and a few others However, when I try to create the fso object I keep receiving an error. 'ActiveX component can't create object: 'Scripting.FileSystemObject'
2
4041
by: Luis Esteban Valencia | last post by:
I'm trying to write a little VB.NET script in an ASP.NET web page that will create folders, move files, etc... pretty much everything you can expect to do using the FileSystemObject library. Is this possible in .NET? If so, how do I do it? I've tried:
7
1338
by: abcd | last post by:
from ASP.NET program how can I check the file existance and get properties of a file on a system....do .net use the same FileSystemObject or are there other .NET calls availbe to work equivalent to FileSystemObject capability... thanks
1
17147
by: G Gerard | last post by:
Hello I am using the FileSystemObject to copy files on a computer Dim MyObject as Object
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10357
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10162
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10101
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4063
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.