winscp.com attempting to automate upload from c:\windows\system32\certsrv\certenroll\

Advertisement

cs_280zx
Joined:
Posts:
4
Location:
Sydney

winscp.com attempting to automate upload from c:\windows\system32\certsrv\certenroll\

hi, we have two server 2012 R2 servers with winscp (gui client) installed (version: 5.7.4 - build 5553) and we have scripted it to attempt to upload files from the server where the winscp is installed, to two web servers.

i have tested the script and it does work from a (different directory) and on another pc (windows 8.1) but for some reason, it wont 'put' files referenced from that directory, any suggestions or steps i am missing? i searched around and wasnt able to find anything like my situation
ps: its used to upload crl's for our pki servers as part of the 2012 PKI infrastructure here.


script launch parameters:
c:\Program Files (x86)\WinSCP>winscp.com /script=c:\scripts\crl_transfer_pki.txt

===

script layout
===
# This script uploades the newly created CRLs To the PKI servers And overwrites existing files On the PKI Hosts
# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect to SFTP server PKI-01 using a password
open sftp://xxxxxxxx:xxxxx@xxxxx.replaceme.com.au/ -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
# Change remote directory *using a temp location*
cd /var/www/html/CertEnroll
# Upload file
put C:\Windows\System32\certsrv\CertEnroll\*.crl
#
# Disconnect
#
#
# Connect to SFTP server PKI-02 using a password
open sftp://xxxxxxxx:xxxxx@xxxxx.replaceme.com.au/ -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
# Change remote directory *using a temp location*
cd /var/www/html/CertEnroll
# Upload file
put C:\Windows\System32\certsrv\CertEnroll\*.crl
#
# Disconnect
close
# Exit WinSCP
exit

===

when run, this is the output:

===
batch abort
reconnecttime 120
confirm off
Searching for host...
Connecting to host...
Authenticating...
Using username "crl".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Session started.
Active session: [1] crl@xxxxx.replaceme.com.au
/var/www/html/CertEnroll
No file matching '*.crl' found. (System Error. Code: 3.

The system cannot find the path specified)
Searching for host...
Connecting to host...
Authenticating...
Using username "crl".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Session started.
Active session: [2] crl@xxxxx.replaceme.com.au
/var/www/html/CertEnroll
No file matching '*.crl' found. (System Error. Code: 3.

The system cannot find the path specified)
Session 'crl@xxxxx.replaceme.com.au' closed.
Active session: [1] crl@xxxxx.replaceme.com.au

===

i can verify files exist in this directory also, and it was executed in an elevated command prompt, logged in using domain administrator on the 2012 R2 server.

any suggestions or assistance is appreciated

thanks

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: winscp.com attempting to automate upload from c:\windows\system32\certsrv\certenroll\

The C:\Windows\System32 folder is "magic" on 64-bit Windows. It shows a different contents to 32-bit applications (WinSCP) than to 64-bit applications (e.g. Windows Explorer).

To 32-bit application (WinSCP), it shows actually a contents of C:\Windows\SysWOW64, where there's no certsrv subfolder.

There's probably no direct way to access certsrv from WinSCP. You can though create a directory junction to the subfolder to create an alternative access path.

Reply with quote

cs_280zx
Joined:
Posts:
4
Location:
Sydney

hi thankyou for your suggestion, sorry for the delay many projects to manage at the moment. i will give your suggestions a go on monday and let you know the results.

thanks
carl

Reply with quote

cs_280zx
Joined:
Posts:
4
Location:
Sydney

hi there,
i used the command mklink "c:\scripts\linked\ c:\Windows\System32\certsrv\CertEnrol"

now i changed the path in the txt file as follows::


=========
# Connect to SFTP server PKI-02 using a password
open sftp://xxxxxxxx:xxxxx@xxxxx.replaceme.com.au/ -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
# Change remote directory *using a temp location*
cd /var/www/html/CertEnroll
# Upload file
put C:\scripts\linked\certenroll\*.crl
#
# Disconnect
close
# Exit WinSCP
exit

=========

Reply with quote

Advertisement

You can post new topics in this forum