Powershell - creating files and folders programmatically

by robotix1986 22. October 2009 12:24

To create a file programmatically we can use the below command: -

new-item -path c:\Test -name MyTestFile.txt -type "file" -value "This is a Test File with sample contents."

the above command creates a file "MyTestFile.txt" within the "C:\Test" directory with the given contents.

To create a folder, we can use the below command: -

new-item -path D:\MyAlreadyExistingFolder -name MyNewFolder -type directory

This command creates a folder named "MyNewFolder" within the "MyAlreadyExistingFolder" folder.

The essential thing to be noted in the above commands is the 'new-item' cmdlet. For more details and additional usage of this command visit this page.

Till my next post

Regards,
AlD

Tags:

Comments

12/27/2009 3:20:51 AM #

cash loans

Just wanted to say thanks for this.

cash loans United States | Reply

1/7/2010 9:36:17 AM #

truth about six pack abs

This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work.

truth about six pack abs United States | Reply

1/11/2010 8:04:38 PM #

Niche Blueprint

You write very well. Kept me really engaged for some time Smile

Niche Blueprint United States | Reply

1/14/2010 8:19:00 PM #

Lupus diet

Good post.

Lupus diet United States | Reply

1/16/2010 6:53:44 AM #

consumer reports

I completely agree with the above comment, the internet is with a doubt growing into the most important medium of communication across the globe and its due to sites like this that ideas are spreading so quickly.

consumer reports United States | Reply

1/20/2010 5:32:54 AM #

pc hjælp

Nice to be visiting your blog again, it has been months for me. Well this article that i've been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share.

pc hjælp United States | Reply

1/25/2010 8:19:17 AM #

roulette sniper

Just wanted to give you a shout from the valley of the sun, great information. Much appreciated.

roulette sniper United States | Reply

1/28/2010 9:46:34 AM #

how to sell on ebay

I was looking for crucial information on this subject. The information was important as I am about to launch my own portal. Thanks for providing a missing link in my business.

how to sell on ebay United States | Reply

2/2/2010 1:08:00 AM #

decorative hardware

Me and my friend were arguing about an issue similar to this! Now I know that I was right. lol! Thanks for the information you post.

decorative hardware United States | Reply

2/6/2010 10:01:26 AM #

payday loans

You can never plan the future by the past.

payday loans United States | Reply

2/7/2010 4:19:35 AM #

payday loans

Real success comes in small portions day by day. You need to take pleasure in life's daily little treasures. It is the most important thing in measuring success.

payday loans United States | Reply

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About robotix1986

Yet another software developer in the software industry writing some kewl code and exploring new technologies when not doing the routine work stuff.

RecentComments

Comment RSS
Software Blogs - BlogCatalog Blog Directory