简体   繁体   中英

Batch file doesn't execute specified .exe on remote computer

I am trying to install a program on a remote computer using a command line argument and a batch script. For testing, I'm installing Notepad++ as the program.

Here is the command line I'm using to access the remote computer:

psexec \\comp-2 -h -u localAdmin -p password -c -f C:\install-npp.bat

This is the batch file code I've written:

@echo off
@echo Hello this creates a pointless temp file >C:\temp\EmptyFile.txt
xcopy \\FILESVR\Shared\npp.exe C:\temp\npp.exe
start C:\temp\npp.exe
pause

(Please note: the second line is only to make sure that the script is in fact doing something).

When I run the psexec command listed above from my first computer, the EmptyFile.txt is created, and npp.exe is copied over to the temp directory, but the executable is never run.

What am i doing wrong? the machines are in a windows workgroup.

Thanks in advance!

the start command is waiting a title as first argument so try start "" c:\\temp\\npp.exe .

BTW looking at http://coreworx.blogspot.fr/2010/07/unattended-installation-notepad.html I saw you will have to add /S to make a silent install of npp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM