473,399 Members | 3,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

create subdir

Hi!,

Im am using the VB Express Beta2 but cannot figure out how to create a
subdir in the windows directory.

Code:

Dim windowsdir as String
Dim dircreate
dircreate="backup"
windowsdir=environ$("windir")
My.Computer.FileSystem.CreateDirectory(windowsdir)

I want to create the directory "backup" under the windows directory and i
don't want to use the absolute path, what am i missing?

Thanks.

Jacco

Nov 21 '05 #1
5 1361
"DizWiz" <di****@dizwiz.com> schrieb:
Dim windowsdir as String
Dim dircreate
dircreate="backup"
windowsdir=environ$("windir")
My.Computer.FileSystem.CreateDirectory(windowsdir)

I want to create the directory "backup" under the windows directory and i
don't want to use the absolute path, what am i missing?


\\\
Imports System.IO
..
..
..
My.Computer.FileSystem.CreateDirectory( _
Path.Combine(Environ("windir"), "backup") _
)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #2
Thanks for the reply, but solved it anothing way:
Dim winenv
Dim dircreate
winenv=environment.GetenvironmentVariable("windir" )
dircreate=(winenv)&"\backup"
My.Computer.FileSystem.CreateDirectory(dircreate)

Please comment

Jacco

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uN**************@TK2MSFTNGP09.phx.gbl...
"DizWiz" <di****@dizwiz.com> schrieb:
Dim windowsdir as String
Dim dircreate
dircreate="backup"
windowsdir=environ$("windir")
My.Computer.FileSystem.CreateDirectory(windowsdir)

I want to create the directory "backup" under the windows directory and i
don't want to use the absolute path, what am i missing?


\\\
Imports System.IO
.
.
.
My.Computer.FileSystem.CreateDirectory( _
Path.Combine(Environ("windir"), "backup") _
)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
"DizWiz" <di****@dizwiz.com> schrieb:
Dim winenv
Dim dircreate
winenv=environment.GetenvironmentVariable("windir" )
dircreate=(winenv)&"\backup"
My.Computer.FileSystem.CreateDirectory(dircreate)


I recommend to use types for variables, remove the braces around 'winenv'
and use 'Path.Combine' instead of the string concatenation operator.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4
Thanks for you help, but when i use the following code:

System.Console.Write("Accept Systems - %windir% - backup")

My.Computer.FileSystem.CreateDirectory(Path.Combin e(Environ("windir"),
"backup"))

Name "path" is not declared

Jacco
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uC**************@TK2MSFTNGP12.phx.gbl...
"DizWiz" <di****@dizwiz.com> schrieb:
Dim winenv
Dim dircreate
winenv=environment.GetenvironmentVariable("windir" )
dircreate=(winenv)&"\backup"
My.Computer.FileSystem.CreateDirectory(dircreate)


I recommend to use types for variables, remove the braces around 'winenv'
and use 'Path.Combine' instead of the string concatenation operator.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5
"DizWiz" <di****@dizwiz.com> schrieb:
Thanks for you help, but when i use the following code:

System.Console.Write("Accept Systems - %windir% - backup")

My.Computer.FileSystem.CreateDirectory(Path.Combin e(Environ("windir"),
"backup"))

Name "path" is not declared


That's why I said that 'Imports System.IO' is required in the file's
'Imports' list.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #6

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

Similar topics

4
by: DizWiz | last post by:
Hi!, Im am using the VB Express Beta2 but cannot figure out how to create a subdir in the windows directory. Code: Dim windowsdir as String Dim dircreate dircreate="backup"
5
by: Ken Fine | last post by:
I want my application to maintain a directory tree based on months and years, e.g.: 2004 January file file file February file
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
4
by: I_AM_DON_AND_YOU? | last post by:
There is one more problem I am facing but didn't get the solution. In my Setup Program I am not been able to create 2 things (when the program is intalled on the client machine ) : (1) create...
10
by: Zack Sessions | last post by:
Has anyone tried to create a SQL7 view using the CREATE VIEW command and ADO.NET? If so, is there a trick in trapping a SQL error when trying to create the view? I have a VB.NET app that, amoung...
4
by: ThunderMusic | last post by:
Hi, My App must get the files *.Ext in AppPath\SubDir\. What's the best way to achieve this using .NET framework 1.1? thanks
37
by: Steven Bethard | last post by:
The PEP below should be mostly self explanatory. I'll try to keep the most updated versions available at: http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt...
18
by: Steven Bethard | last post by:
I've updated the PEP based on a number of comments on comp.lang.python. The most updated versions are still at: http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt...
23
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.