Author Topic: OneDrive - File Folders  (Read 686 times)

0 Members and 1 Guest are viewing this topic.

Offline Heather Reetz

  • True Believer
  • ****
  • Posts: 583
  • Karma: +124/-0
OneDrive - File Folders
« on: July 26, 2017, 03:23:38 pm »
Is there a way to import a list of folder names?

I have a long list of folder names.  Is there any way that I can use the list to create the folders so I don't have to create them one at a time.
Heather Reetz
Yes, there really is a Kalamazoo!
50ish Users; 15 remote, Epic Cloud, 2016 Servers, Terminal Services w/RDP, 3CX VOIP, O365/Pro Plus, HP Wyse & Dell Thin Clients, iPads, iPhones

Offline Jeff Golas

  • Administrator
  • Scalliwag
  • *****
  • Posts: 3020
  • Karma: +342/-0
    • JKJ Website
Re: OneDrive - File Folders
« Reply #1 on: July 27, 2017, 10:45:46 am »
This can be done a million ways, but easiest with Powershell. Have you used it at all? What are you attempting to do?
Jeff Golas
Johnson, Kendall & Johnson, Inc. :: Newtown, PA
Epic Online w/CSR24
http://www.jkj.com

Offline Heather Reetz

  • True Believer
  • ****
  • Posts: 583
  • Karma: +124/-0
Re: OneDrive - File Folders
« Reply #2 on: July 27, 2017, 11:00:18 am »
I have not used it at all.  I found it, looks like DOS.  I've used DOS, but it's been many years.

I have a spreadsheet with two lists.  One has 419, one 174.  We need a folder for each item on each list.  Quick search seems to point me to save as a csv file first.

Then it shows this script:
$folder = "D:\Test\"
$name = Import-Csv D:\Test\Test.csv
Foreach ($line in $name)
{
    New-Item -path $folder -Name $line.Name -Type Directory
}

I'm in the folder where I want all of the folders to reside, and I've saved the csv files to C:\Temp (one for each list).  I just can't wrap my head around how to translate this.
« Last Edit: July 27, 2017, 11:27:53 am by Heather Reetz »
Heather Reetz
Yes, there really is a Kalamazoo!
50ish Users; 15 remote, Epic Cloud, 2016 Servers, Terminal Services w/RDP, 3CX VOIP, O365/Pro Plus, HP Wyse & Dell Thin Clients, iPads, iPhones

Offline Jeff Golas

  • Administrator
  • Scalliwag
  • *****
  • Posts: 3020
  • Karma: +342/-0
    • JKJ Website
Re: OneDrive - File Folders
« Reply #3 on: July 27, 2017, 11:58:21 am »
Yup that looks like it'll work...I'll translate..

$folder = "D:\Test\"    (creates a reference to the folder under which you want to create more folders)
$name = Import-Csv D:\Test\Test.csv   (Opens your CSV file for processing - you need to change it to the path of the CSV)
Foreach ($line in $name)     (Read your CSV line-by-line, and for each line, get the folder name, and create it)
{
    New-Item -path $folder -Name $line.Name -Type Directory
}

PS that needs to be run IN powershell, not DOS (two different things). If you search for Powershell you will find two options - Powershell itself (just a command prompt), or the Powershell ISE (script editor). Use the ISE for this, paste your code into the top half...fix the paths, then run it with the big PLAY button at the top.
« Last Edit: July 27, 2017, 11:59:56 am by Jeff Golas »
Jeff Golas
Johnson, Kendall & Johnson, Inc. :: Newtown, PA
Epic Online w/CSR24
http://www.jkj.com