Score:0

running powershell command does not take the piped value

cn flag

please tell me what wrong with this syntax:

$computername = 'moti10'
copy C:\sylink\sylink.xml \\$computername\c$\intel\
copy C:\sylink\SylinkDrop.exe \\$computername\c$\intel\
copy c:\sylink\SylinkDropCommand.xml \\$computername\c$\intel\
cd "C:\Users\Administrator\Downloads\pstools\"
psexec" $computername -d -h c:\intel\sylinkdrop.exe
  1. it does not copy the files to the destination computer
  2. psexec does not run - "the string is missing the terminator"
Davidw avatar
in flag
Powershell? I don't see any Powershell. Also, you have a quote after Psexec, but no corresponding quote at the end of the line.
Score:1
in flag

PSexec requires the computer name to be prefaced with the double \\ that indicates you are connecting to a remote system. As for the failure to copy, you may want to fully quote the remote path you are copying the files to, and specify the -destination parameter:

$computername = "moti10"
copy C:\sylink\sylink.xml -destination "\\$computername\c$\intel\"
copy C:\sylink\SylinkDrop.exe -destination "\\$computername\c$\intel\"
copy c:\sylink\SylinkDropCommand.xml -destination "\\$computername\c$\intel\"
cd "C:\Users\Administrator\Downloads\pstools\"
psexec \\$computername -d -h c:\intel\sylinkdrop.exe

(Syntax highlighting seems to be broken, it appears to think there's a stray quote.)

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.