Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

PowerShell basic... "cp" command


  • Please log in to reply
2 replies to this topic

#1 teatrap

teatrap

  • Members
  • 121 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:03:14 PM

Posted 07 December 2013 - 04:16 PM

I'm trying to follow along with something at the moment and I'm using the CP command... 

 

It works fine to copy txt documents that have been created but It won't seem to create a directory for me the way that's being instructed

cp document.txt folder/

The idea is that a directory is created with the folder/ part of that. However I'm just getting an error message

 

Is this due to a change in PowerShell / Window's 8 or am I missing a point here? 

 

Thanks. 


Operating system_Windows 8.1 Pro with Media Center (9600)
CPU_Intel® Core™ i7-4700MQ CPU @ 2.40GHz
Motherboard_Hewlett-Packard (1966)
RAM_12063mb
Hard Drive_931gb (HGST HTS541010A9E680)
Graphics card_Intel® HD Graphics 4600
Sound card_IDT High Definition Audio CODEC


BC AdBot (Login to Remove)

 


#2 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:07:14 AM

Posted 07 December 2013 - 04:54 PM

cp does not create directories. If you want to create the directory, you have to create it first with mkdir.

 

Billy3


Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#3 teatrap

teatrap
  • Topic Starter

  • Members
  • 121 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:03:14 PM

Posted 08 December 2013 - 09:32 AM

Hey Billy, yeah that's what I thought and wasn't sure if something had changed... 

 

I've reviewed the tutorial though and the directory was created prior to copying to it I must have missed it  :unsure:

 

thanks


Operating system_Windows 8.1 Pro with Media Center (9600)
CPU_Intel® Core™ i7-4700MQ CPU @ 2.40GHz
Motherboard_Hewlett-Packard (1966)
RAM_12063mb
Hard Drive_931gb (HGST HTS541010A9E680)
Graphics card_Intel® HD Graphics 4600
Sound card_IDT High Definition Audio CODEC





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users