Avatar of stlhost
stlhost
Flag for United States of America asked on

psexec assistance, parse error

Whats wrong with this? Command echo f|xcopy "\\server\client\connection.RDP" "C:\Users\Public\Desktop\connection.RDP" works fine if you run it by itself.

Pass it through psexec I get Parse Error
Connecting to STC701...
Starting PsExec service on STC701...
Connecting with PsExec service on STC701...
Starting cmd on STC701...
cmd exited on STC701 with error code 4.

@ECHO ON

set controlfile=computers.txt


FOR /F %%L IN (%controlfile%) DO (
  SET "line=%%L"
  psexec \\%%L cmd /c "echo f|xcopy "\\server\client\connection.RDP" "C:\Users\Public\Desktop\connection.RDP"
) >> allpcsresults.txt 2>&1

Open in new window

Windows BatchWindows 7

Avatar of undefined
Last Comment
stlhost

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
oBdA

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
stlhost

ASKER
Thank you
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy