![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Create a folder on a remote machine? Hi, Is there a way to create a folder on a remote machine using PowerShell (not FileSystemObject), e.g. create a new folder "D:\My Folder". <if possible> It should not rely on UNC paths, because it's part of a bigger program that needs to continue running if there's a network outage. Thanks. -- Gerry Hickman (London UK) |
My System Specs![]() |
| | #2 (permalink) | ||||||||||||
| Guest | RE: Create a folder on a remote machine? If you are running PowerShell V2 CTP then you could use the remoting facilities. otherwise you could use WMI $computer = "." $p = [WMIClass]"\\$computer\root\cimv2:Win32_Process" $p.Create("cmd.exe /c md c:\test452") replace the . with the computer name in $computer = "." and put the folder name you need into the create statement -- Richard Siddaway Please note that all scripts are supplied "as is" and with no warranty Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "Gerry Hickman" wrote:
| ||||||||||||
My System Specs![]() | |||||||||||||
| | #3 (permalink) | ||||||||||||||||||||||||
| Guest | Re: Create a folder on a remote machine? Hi,
just a rough example.
RetVal are NOT referenced the calling process. Obviously I want the RetVal from the CreateFolder call, plus any error messages, plus a handle to the newly created folder. I was hoping for some professional grade PowerShell answers. I though PowerShell was going to replace CMD.exe? Having read about how "powerful" it is, and how it's a "shell". It's a joke if we have to shell out to the old CMD.exe for such a simple task. It's also a bit strange that we keep hearing about how PowerShell is so "Powerful" with it's calls to .NET, and yet every non-beginner post keeps jumping back to using WMI which is actually the old COM technology. -- Gerry Hickman (London UK) | ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
| | #4 (permalink) | ||||||||||||
| Guest | Re: Create a folder on a remote machine?
How odd! WMI was good (new?) enough in your post 2 hours ago to microsoft.public.adsi.general:- <<SNIP>> Bear in mind none of this will work with IIS7, they took out the ADSI so it's best to look to new ways of doing it anyway (maybe WMI?) <<SNIP>> What you get from Rich S is about as "Professional Grade" as it gets. I on the other hand am anything but "Professional Grade", but even I can see that given the parameters you provided in your OP the response was fit for purpose and did not deserve your inelegant response. Hope you get the answer your looking for though! Kind regards, -- Stuart | ||||||||||||
My System Specs![]() | |||||||||||||
| | #5 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: Create a folder on a remote machine? On Mar 16, 3:35*pm, Gerry Hickman <gerry66...@xxxxxx> wrote:
Despite what its MS marketing droid bestowed "marquee name" implies with the hyperbolous prefix, Powershell is not magic. It is a framework, a shell and a scripting language that is designed to abstract out the differing APIs on the windows platform such as WMI, COM, .NET etc. Yes, it comes with a handful of built-in cmdlets, and perhaps they are lacking a fair chunk of functionality for v1, but this is by-design. Great extensibility is a better goal for an initial release than an inextensible and purely subjective view of what they felt would be "feature complete" for functionality. I'm sorry if you're having a hard time understanding what the product is and does -- and clearly you are having a hard time -- but hurling insults and calling people clueless will not get you any help, or sympathy for that matter. Ultimately, powerSHELL is a shell. It's job is to allow you to manipulate external services like WMI. It doesn't try to replace it, on the contrary - it is designed to make it easier to use WMI. RichS's solution is perfectly valid. The irony is, if such a "remote folder creation" cmdlet is ever implemented for powershell in the future, it will most likely use COM and/or WMI to do it. Do bash, tcsh, ksh implement internal magic such as what you're suggesting for powershell? No, they do not. They provide a way to execute and manipulate 3rd party executables and leverage CIFS through UNC paths. What you are asking for is not within a reasonable expectations for a "shell." If you don't want to end up in any more killfiles, I suggest you tone down your rhetoric and start reading here: http://www.microsoft.com/windowsserv...l/default.mspx - Oisin | ||||||||||||||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||||||||||||||
| | #6 (permalink) | ||||||||||||||||||||||||
| Guest | Re: Create a folder on a remote machine? You guys way over think this stuff ![]() new-item \\$computer\c$\FolderName -itemType Directory "RichS" <RichS@xxxxxx> wrote in message news:B58F5F2B-7D9C-44EB-8599-A55C9CBCAB25@xxxxxx
| ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
| | #7 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: Create a folder on a remote machine? See my example. It is one line and returns a system.io.directoryinfo object "Gerry Hickman" <gerry666uk@xxxxxx> wrote in message news:ueIMmz5hIHA.4320@xxxxxx
| ||||||||||||||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||||||||||||||
| | #8 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: Create a folder on a remote machine? This was brought up in a side bar. So for clarity. I ignored the UNC restriction purposely. If you lose your network... aint nothing gonna work. "Brandon Shell [MVP]" <tshell._rem_@xxxxxx> wrote in message news:41922DAE-7989-4FA0-B620-946876BD603A@xxxxxx
| ||||||||||||||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||||||||||||||
| | #9 (permalink) | ||||||||||||
| Guest | Re: Create a folder on a remote machine? Hi Brandon,
unexpected, such as resume after power failure. One of the reasons for wanting to do it without UNC is that my project is a large batch job that runs unattended, it's quite possible some servers will be rebooted while the job is running, it's therefore important that my job runs "locally" (albeit on the remote machine). Actually this is quite common. Most Microsoft technology is designed to work this way (e.g. Windows Update, Vista SP1 etc). So, do you have a PowerShell/.NET means of creating a folder on a remote machine? -- Gerry Hickman (London UK) | ||||||||||||
My System Specs![]() | |||||||||||||
| | #10 (permalink) | ||||||||||||||||||||||||||||||||||||||||||||||||
| Guest | Re: Create a folder on a remote machine? Hi Oisin,
I'm interested in how to make it WORK, NOT excuses about why it doesn't.
above!
PowerShell, His example is FLAWED is ANY language, I should have x-posted it to the C++ group, at least they'd confirm it's flawed. It's not RichS's fault, he copied it from Microsoft own clueless website. -- Gerry Hickman (London UK) | ||||||||||||||||||||||||||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Exch 2003, create Mailbox from Vista machine? | Gerry Hickman | PowerShell | 11 | 04-16-2008 09:47 AM |
| checked for logged on user on remote machine + remote reboot | Ben Christian | PowerShell | 2 | 03-10-2008 06:52 PM |
| getting remote machine directory | IT Staff | PowerShell | 3 | 07-19-2007 04:11 AM |
| Can't create a new file or folder with in a shared folder on a Windows XP machine. Basic Vista networking questions | Nate Goulet | Vista installation & setup | 4 | 04-18-2007 04:20 AM |
| HowTo: Run a Command (.exe or .cmd) on a Remote Machine | Brandon Shell | PowerShell | 6 | 09-18-2006 06:17 AM |