Click here to Skip to main content
15,885,951 members

Comments by rammohan004 (Top 3 by date)

rammohan004 2-Apr-13 6:32am View    
Thanks for the Help Mike..
It really Worked for me..
rammohan004 1-Apr-13 0:51am View    
Hi Mike,

Thanks for the Reply..

I tried as you said..I Kept a breakpoint in string 'c' and tried to execute that string directly from the powershell and command executed successfully.


string cmd1 = "net use \\\\"+server+"\\"+str+" \"support@123\" /USER:ibmairtelafrica\\l2support";
dest = dest + "\\\\";

string cmd2 = "if(!(Test-Path -path \"\\\\" + server + "\\" + dest + "\")) {New-Item \"\\\\" + server + "\\" + dest + "\" -Type Directory}";

string cmd3 = "copy-item -path \"" + source + "\" \"\\\\" + server + "\\" + dest + "\" -Recurse -Force";

string c = cmd1 + ";" + cmd2 + ";" + cmd3;
startInfo.Arguments = c;



It Executes Successfully from the Powershell..
But from visual stdio it was showing the error as you indicated..
So, I did some changes in the s

tring 'dest' to solve that error from the Visual studio.
i.e.

string cmd1 = "net use \\\\"+server+"\\"+str+" \"support@123\" /USER:ibmairtelafrica\\l2support";
dest = dest + "\\\\";



This time Visual Stdio Executes it perfectly..But when i tried copying the files which contains white spaces it doesnot worked..

Again I did inserted all the path inside ("") but still it didn't worked for me..
<pre lang="c#">
string cmd2 = "if(!(Test-Path -path \"\"\\\\" + server + "\\" + dest + "\"\")) {New-Item \"\"\\\\" + server + "\\" + dest + "\"\" -Type Directory}";

string cmd3 = "copy-item -path \"\"" + source + "\"\" \"\"\\\\" + server + "\\" + dest + "\"\" -Recurse -Force";

string c = cmd1 + ";" + cmd2 + ";" + cmd3;
startInfo.Arguments = c;


Plz tell me what to do here..

Thanks and Regards..
rammohan004 28-Mar-13 2:52am View    
Hi Rajesh,
Thanks for the Reply.
This can happen only if my NetBios in the remote is Enable.But What if NetBios is disabled in the remote system.?