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

Author Message
cs_280zx
[View user's profile]

Joined: 2015-06-26
Posts: 4
Location: Sydney
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
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
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.
cs_280zx
[View user's profile]

Joined: 2015-06-26
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
cs_280zx
[View user's profile]

Joined: 2015-06-26
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

=========
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
And does it work?
cs_280zx
[View user's profile]

Joined: 2015-06-26
Posts: 4
Location: Sydney
hi there, yes it is working successfully now with the links created as advised.

thankyou for your help
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License