How to Specify PSEXEC file Copy path in remote System - windows

I'am using the below PSEXEC switches to copy a file to remote system. By default it copies to C:\Windows. I have created a new folder C:\Suba, and the file needs to be copied to that path.
PsExec -f -c -d -u domain\username -p P#ssw0rd "\\10.XXX.XXX.XXX" "\\sharepath\list.exe" "C:\Suba"
This copies the list.exe from the share path to destination system to the path C:\Windows. But I need to be copied to C:\Suba
Thanks.

Related

How to run batch file after file download (from Linux to Windows) throught FTP in Windows

I am doing file copy from Linux to Windows share through FTP.
Once copy is done I am moving it to isilon storage which is shared on network path (manually).
Now I have created a batch file, which will do copy from FTP shared path to network path.
So how can I start batch file after FTP download? How can I automate it completely?
from Linux
ftp -n ip
user "user" "pwd"
put app.tar.gz
Once it is done i want to move it network shared path
Just use the copy command in a batch file, after the ftp.exe finishes:
ftp.exe -s:download.txt
copy c:\dowloadtarget\myfile.txt \\server\share\target\myfile.txt
You can run the copy even from the FTP script (the download.txt), if you need it for some reason. Use the ! (escape to shell) command.
get /remote/path/myfile.txt c:\dowloadtarget\myfile.txt
! copy c:\dowloadtarget\myfile.txt \\server\share\target\myfile.txt
But why don't you download the file directly to the shared folder?
get /remote/path/myfile.txt \\server\share\target\myfile.txt

How to specify destination path using mget command

I am trying to copy multiple files from Linux machine to Windows using mget. Files are getting downloaded, but I'm not able to specify the destination directory (Windows directory)
The mget does not allow you to explicitly specify target local directory.
It always downloads the files to the current local working directory.
Though, you can change the local working directory using lcd command:
ftp> lcd C:\path
Local directory now C:\path.
ftp> mget *.*

How to write command in windows batch file to copy a zip file from an FTP path to a local folder in my computer

I want to copy a zip file from an FTP path to a local folder in my computer.
My client previously used coreftp.exe for that purpose. But now he ask us to use ftp.exe [default in windows machine, available at C:\Windows\System32\ftp.exe] for that purpose. The ftp is in the format :
ftp://username#ftpserver.address.com
And want to download it to d:\sample\docs folder on my machine.
I want that in a batch file so that I can schedule it through windows task manager.
So could you please help me to write that command on the batch file.
Thanks a lot in advance.
FTP.EXE is capable of executing script files. So you could just put this into your bat file:
#ECHO OFF
CD d:\sample\docs
FTP -v -i -s:C:\some\path\ftpscript.txt
And something like this into your ftpscript.txt:
open ftp://ftpserver.address.com
username
password
cd myfolder
get some_zip_file.zip
disconnect
bye
This will download some_zip_file.zip into the current directory (d:\sample\docs).

How do i change the root folder that psexec.exe uses?

Im trying to run a batch file on remote computer using psexec.exe
My code is;
psexec.exe \\192.168.13.187 -u Administrator -p default -d -i c:\temp\abc.bat
But when i execute this on command prompt, it connects to remote server's system32 folder then start the batch file.. Problem is that batch file has some CALL method in it (like CALL XXX.BAT) (XXX.BAT file is in the same folder.) Since psexec.exe uses system32 folder as root path, after running c:\temp\abc.bat file successfully, it could not CALL the other batch file. throwing 'could not find the file specified'..
My question is; how do i use the remote C:\temp\ folder as a root path after connecting the remote computer ?
Thanks for help in advance !!
Use the -w switch Luke.
-w directory Set the working directory of the process (relative to the remote computer).

How to determine full names for local Mac filename and remote filname to use SCP

I used SSH to connect to a server and navigate to the folder where I want to store some files from my Mac. I think what I need to do is use SCP to do the copy but I'm not sure exactly about the terminology in the command parameters. And so far everything I've tried gets some sort of "not found" error.
Before logging on to the server the prompt is :
Apples-MacBook-Pro-2:~ neiltayl$
After logging in and navigating to the folder I want to store things in it is :
[neiltayl#cs136 Tracer]$
I need to copy several files from the Tracer folder on my local computer to the Tracer folder on cs136 and cannot fathom the correct parts of the respective FROM and TO parts of SCP to make it work.
This is the nearest I got so far;
Apples-MacBook-Pro-2:~ neiltayl$ ls
Applications Downloads Music Tracer
Desktop Library Pictures c151
Documents Movies Public dwhelper
Apples-MacBook-Pro-2:~ neiltayl$ scp ./Tracer/*.* neiltayl#cs136.cs.iusb.edu:Tracer
neiltayl#cs136.cs.iusb.edu's password:
./Tracer/*.*: No such file or directory
The scp command is -
$ scp File1 username#someting:DIRNAME
Here File 1 is the file that you are sending over to the other computer.
DIRNAME is the path to the directory where you want the file to be stored.
In your case the command would be
scp -r Tracer neiltayl#cs136:New_Tracer
Here Tracer is the folder that contains all the files that you want to copy.

Resources