<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>vbscriptblog.com &#187; file</title>
	<atom:link href="http://vbscriptblog.com/category/powershell/file/feed/" rel="self" type="application/rss+xml" />
	<link>http://vbscriptblog.com</link>
	<description>Scripting for Windows Sysadmins</description>
	<lastBuildDate>Mon, 16 Jan 2012 09:41:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Files: Powershell command to copy a file to another directory</title>
		<link>http://vbscriptblog.com/powershell/files-powershell-command-to-copy-a-file-to-another-directory/</link>
		<comments>http://vbscriptblog.com/powershell/files-powershell-command-to-copy-a-file-to-another-directory/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 14:02:05 +0000</pubDate>
		<dc:creator>dirk adamsky</dc:creator>
				<category><![CDATA[file]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[copy-item]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[files]]></category>

		<guid isPermaLink="false">http://deludi.nl/blog/?p=310</guid>
		<description><![CDATA[Okido, here&#8217;s my first powershell script (or command line). The action I want to accomplish is to copy a file to another directory. I installed powershell v2 on my machine. To open the powershell prompt you can do next steps: give &#8216;windows key + r&#8217; (opens &#8216;Start=&#62;Run&#8217;) give &#8216;powershell&#8217; without the quotes the powershell prompt [...]]]></description>
			<content:encoded><![CDATA[<p>Okido, here&#8217;s my first powershell script (or command line).</p>
<p>The action I want to accomplish is to copy a file to another directory.<br />
I installed powershell v2 on my machine.<br />
<a href="http://deludi.nl/blog/wp-content/uploads/2010/02/powershellstart.png"><img class="alignright size-medium wp-image-311" title="powershellstart" src="http://deludi.nl/blog/wp-content/uploads/2010/02/powershellstart-300x90.png" alt="" width="300" height="90" /></a><br />
To open the powershell prompt you can do next steps:</p>
<ul>
<li>give &#8216;windows key + r&#8217; (opens &#8216;Start=&gt;Run&#8217;)</li>
<li>give &#8216;powershell&#8217; without the quotes</li>
<li>the powershell prompt now opens</li>
</ul>
<p>When you want to change the working directory give cd followed by the full path, for example &#8216;cd c:temp&#8217; (without quotes).<br />
<a href="http://deludi.nl/blog/wp-content/uploads/2010/02/powershellchangeworkingdiractioncompleted.png"><img class="alignright size-medium wp-image-318" title="powershellchangeworkingdiractioncompleted" src="http://deludi.nl/blog/wp-content/uploads/2010/02/powershellchangeworkingdiractioncompleted-300x79.png" alt="" width="300" height="79" /></a><br />
After changing the working directory it is time for action.<br />
In &#8216;c:temp&#8217; I created a file named &#8216;test.txt&#8217; and a directory called &#8216;c:temptest&#8217;.<br />
The powershell command to copy &#8216;test.txt&#8217; to the &#8216;test&#8217; directory is:</p>
<p><a href="http://deludi.nl/blog/wp-content/uploads/2010/02/copyfile.png"><img class="alignright size-medium wp-image-319" title="copyfile" src="http://deludi.nl/blog/wp-content/uploads/2010/02/copyfile-300x87.png" alt="" width="300" height="87" /></a><br />
copy-item c:temptest.txt c:temptest</p>
<p>The result is that the file test.txt is copied to c:temptesttest.txt.<br />
Instead of using copy-item you can also use the aliases &#8216;cp&#8217; or &#8216;cpi&#8217;.</p>
<p>Happy scripting.</p>
<p>Best regards,</p>
<p>Dirk Adamsky &#8211; Deludi BV</p>
<div class="bottomcontainerBox" style="background-color:#F0F4F9;">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fvbscriptblog.com%2Fpowershell%2Ffiles-powershell-command-to-copy-a-file-to-another-directory%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://vbscriptblog.com/powershell/files-powershell-command-to-copy-a-file-to-another-directory/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://vbscriptblog.com/powershell/files-powershell-command-to-copy-a-file-to-another-directory/"  data-text="Files: Powershell command to copy a file to another directory" data-count="horizontal" data-via="dirkadamsky">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://vbscriptblog.com/powershell/files-powershell-command-to-copy-a-file-to-another-directory/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div>]]></content:encoded>
			<wfw:commentRss>http://vbscriptblog.com/powershell/files-powershell-command-to-copy-a-file-to-another-directory/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

