2

I have existing batch scripts which work in windows xp. These scripts use rcp and rsh commands that are supported in windows xp .

These scripts are used to connect to a unix box and transfer files to it. Later using rsh, the files are installed on the system.

In Windows 7 these commands seems to be unavailable. I am stuck on how to make existing installation work on windows 7

Any help in this regard would be appreciated.

Sudhakar Singh
  • 389
  • 7
  • 19

3 Answers3

1

A quick Google search will show you that both RCP and RSH are -

"not available by default in Windows 7 but can be enabled by turning on the Subsystem for UNIX-based Applications Windows feature from Programs and Features in Control Panel and then installing the Utilities and SDK for UNIX-based Applications available here."

unclemeat
  • 5,029
  • 5
  • 28
  • 52
  • I have tried this option, but they are Unix based commands and are different in syntax and usage than the commands that were available with the Command prompt of the windows – Sudhakar Singh Mar 27 '14 at 02:51
  • Presumably though, they have the ability to do the same thing, even if the syntax is different. Take a look at the usage of those commands in Windows. Try `rcp /?` and `rsh /?`. If that doesn't give you help for those commands, just Google their Windows usage. – unclemeat Mar 27 '14 at 21:29
  • @SudhakarSingh Has this worked for you, if not, what is the problem? – unclemeat Mar 30 '14 at 08:07
  • This didn't work. I tried using the rcp with the new executable by copying it to the system32 folder. It gives unknown error while i try to transfer the file. The command is : " rcp test.txt xx.xxx.xx.32.root:/tmp " where xx.xxx.xx.32 is the IP of the remote unix system – Sudhakar Singh Apr 01 '14 at 04:42
  • What do you mean by "Unknown error", what does it say? You could try using `WinSCP` instead of `rcp`. – unclemeat Apr 01 '14 at 05:38
  • It gives me this error "ux:ksh: ERROR: rsh: not found" as internally it tries to use rsh – Sudhakar Singh Apr 01 '14 at 06:10
  • That's right, it's a [free client for windows](http://winscp.net/eng/index.php), with basically the same [command line extensible](http://winscp.net/eng/docs/commandline) as `scp`. You just need to download it. – unclemeat Apr 01 '14 at 22:45
  • Two relevant data for anyone considering installing the subsystem: you need Win 7 Ultimate or Enterprise (https://superuser.com/questions/212864/sua-missing-from-windows-features?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa) (not Home, not Pro) and for Intel Core processors one has to nonintuitively [download the AMD64 version of the file](https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/9d3da292-c1c6-4852-9342-35d232a5f1fb/cant-install-utilities-and-sdk-for-subsystem-for-unixbased-applications?forum=windowssdk). – joseph_morris Apr 30 '18 at 20:30
0

Found a solution to this problem. The below steps needs to be followed:

  1. Copy the following executable and dlls from windows xp machine to a folder (say c:\Windows\OldTools) on your windows 7 machine
    • advapi32.dll
    • kernel32.dll
    • msvcrt.dll
    • mswsock.dll
    • rcp.exe
    • rsh.exe
    • user32.dll
    • ws2_32.dll

  2. Click on start menu -> right click on computer -> select Properties -> Advanced System Settings -> Environment Variables -> In "System Variables" section double click on "Path" -> Add the following text at the end

    ;c:\Windows\OldTools

    The scripts now recognizes the rcp and rsh commands.
Sudhakar Singh
  • 389
  • 7
  • 19
0

I tried this solution on a Windows 10 machine. But when executing rcp.exe (or rsh.exe) I got the following error window:

"The procedure entry point DnsGetIpAddressList could not be located in the dynamic link library C:\test-rcp\MSWSOCK.DLL."

C:\test-rcp\ is the folder where I copied the .exe and the dll files.

I gave a try to delete the mswsock.dll. After doing that, running rcp (without parameters) showed the help (started to look good!) However, I executed a test to copy a local file to a remote server with a RSHD daemon running, and the file was not copied. rcp didn't throw any error message. The RSHD daemon is working fine when rcp'ing files from a server with old Windows version supporting rcp.