%TIMESTAMP% in WinSCP scripting is not resolved - datetime

I have script that will download the files from SFTP server to Windows using execute command in SSIS with winscp.exe as my executable. But I need the datetime stamp from the previous date in my file.
option batch abort
option confirm off
open sftp://username:password#10.10.20.20/ -hostkey="ssh-rsa XXXX-XXXX-XXXX"
get "/app/informatica/infaadm/9.5.1/server/infa_shared/BID/testing.csv" "D:\SSIS_Test\testing_%TIMESTAMP%.csv"
close
But when I ran the execute command only testing_%TIMESTAMP%.csv is generated in the target folder.

Your syntax is correct.
If the file is indeed downloaded to a file named testing_%TIMESTAMP%.csv, it must be because you are using a version of WinSCP that does not support the %TIMESTAMP% syntax.
I.e. a version older than 5.6.2.
Download the most recent version.

this work for me:
%TIMESTAMP#yyyymmddhhnnss%
I hope help you.

Related

Can open fontawesomefx-glyphsbrowser- windows batch file

Can someone tell how to open font awesome font browser (linked below)- windows batch file.
when I double click, command is opening but it shows an exception and closing.
How can I know whats wrong even a documentation link would be very helpful?
https://github.com/Jerady/fontawesomefx-glyphsbrowser
thank you
I just fixed it by dragging and dropping the fontawesomefx-glyphsbrowser.file into cmd and hitting enter that showed the error which showed that my JAVA_HOME is not set up correctly.
Try this 1.0 version https://www.jensd.de/wordpress/?p=2498, the 1.3.0 version can't open.
I faced the same problem too but solved it by updating java, I used javacpl.exe (you'll find it in the C:\Program Files\Java\jre\bin or the location you installed your java in(the jre/bin folder) )
Then i updated my JAVA_HOME and JRE_HOME path in environment variables with the updated jdk and jre folder location.
I then opened cmd and ran "java -version " to confirm that java was in path.
lastly i executed the "fontawesomefx-glyphsbrowser.bat" file and it worked.
Hi Well i had this issue too and i fixed you go to the java Folder/ bin folder and search for jvm.dll (in my case i found jvm1.dll ) so you copy it and create a folder name it Server if you found it before just copy the jvm.dll in it if you find it jvm1.dll just rename it and magic happen ! hope that i helped you

Where is the Rserve Config file located on Windows?

I'm using a Windows 7 x64 machine with R-3.1.0. I installed the Rserve package through Rstudio.
The start of Rserve is successful with the following code in Rstudio:
library(Rserve)
Rserve()
I got the following output:
Starting Rserve...
"C:\R\R-31~1.0\library\Rserve\libs\x64\Rserve.exe"
My problem is that I couldn't locate the configuration file. Apparently it can't be "/etc/Rserv.conf".
I did come across a webpage saying that the config file is Rserv.cfg in the working directory (unless changed at compile-time). But which working directory? I have checked the working directory of the current R project as well as the Rserve library directory, but it was not there...Could someone help me with this please? Thank you.
Rserve does not automatically come with a config file, you must make one. Best steps for doing so:
Navigate to the file where you just installed Rserve.exe (C:\R\R-31~1.0\library\Rserve\libs\x64\R, based on the message you copied here)
Find Rserve.exe, Reserve_d.exe, and Rserve.dll there. Copy these files.
Navigate to where R.dll is on your computer. This is probably C:\Program Files\R\R-3.1.3\bin\x64, but may be different depending on where you installed R to.
Copy the 3 files mentioned above to this location.
Create a text file here named "Rserv.cfg" with the arguments you are looking for, such as port 6312 or library(mvoutlier). Yes, I know that this is different from the documentation, but if you start Rserve_d.exe you will see that this is the file it is looking for. I have not had success naming it anything else.
You can start Rserve by specifying the location of the config file. In R instead of just Rserve() try the following:
Rserve(args="--RS-conf C:\\folder\\Rserv.cfg")
If path is more complicated you need to massage it a little bit:
Rserve(args="--RS-conf C:\\PROGRA~1\\R\\R-215~1.2\\library\\Rserve\\Rserv.cfg")
Look in the $RHOME/bin directory
If you can't find it here is a different way to approach it:
Download Rserve at [http://rforge.net/snapshot/Rserve_.tar.gz], and save it in your desired directory
Run R CMD INSTALL Rserve_.tar.gz
This allows you to leave Rserve where you want it.
After looking at the Rserve source code and making some test I found that on Windows platform Rserve try to load the configuration file from the current working directory. Also pay attention because on Windows the file name is RServ.cfg and not Rserv.conf as documented.
The current working directory depends of the process, for example using RStudio by default it is your Documents and Settings folder:
C:\Users\[username]\Documents
but can be changed in the "Global Options" of the IDE
So you can create an "RServ.cfg" text file in that directory with your needed options and starting RServe in the usual way in RStudio
Rserve()
will load your configuration.

Run SQLite3 in Windows7 - Not Working (unless I Run as Admin)

I downloaded sqlite3, added sqlite3.dll, sqlite3.def and sqlite3.exe to Windows/System32. System32 is in the Windows Path. When I run SQLite3 test.db as per the Quick Start documentation from SQLite, SQLite3 is not recognized.
I also tried registering the dll but that did not work. I looked at numerous posts here and elsewhere but I cannot figure it out.
If I run sqlite3 at the cmd prompt, in System32, it is recognized. But obviously, unless I am missing something I do not want to create databases in the System32 folder. (Update)When I run a command prompt as admin, SQLite3 is recognized. Is that normal?
I guess I am viewing this as the same as Java, in the sense that once Java was added to the path I can run the Java comd from anywhere.
Conversely running in linux has been a smooth event.
Thank you,
diek
Aha! I had the same problem today. sqlite3.exe wouldn't be recognized if it was in C:\Windows\System32 (though interestingly it would work in C:\Windows) and that location was in the path.
I solved this by "unblocking" the file as it was a downloaded file that Windows doesn't trust: Properties > General > "Unblock"
This would possibly explain why running as admin worked.
It is also possibly related to this issue of 32-bit vs. 64-bit windows, though I think it is the earlier blocking problem.

Eclipse Plugin- How to execute UNIX command from eclipse plugin?

I am writing an eclipse plugin that will take input of a file name, pass that to a UNIX command and get the output back (The command is to get file path of entered file name from CVS repository). My basic plugin code is under development, but I am not finding any info on how can I execute UNIX commands from eclipse. Any pointers would be helpful.
Runtime.exec(...) from the Java standard library should do what you need to execute UNIX shell commands that are in your path of the user that is executing eclipse. If you want to call UNIX C libraries API you can use the JNA library.

Windows Command prompt shell for sqlite3

The documentation states that there is a command-line shell for sqlite3:
To start the sqlite3 program, just type "sqlite3" followed by the name the file that holds the SQLite database."
When I try this, in the Windows Command Prompt I get the error message:
'sqlite3' is not recognized as an internal or external command,
operable program or batch file.
Windows explorer reveals several 'Sqlite3" folders in various places:
backends(C:/Python26/Lib/site-packages/django/db)
Lib(C:/Python26)
backends(C:/Django-1.1.1/Django-1.1.1/build/lib/django/db
backends(C:/Django-1.1.1/Django-1.1.1/django/db)
How do I access the shell, can anyone help?
Download sqlite3 binary for windows here. Unzip it and put it somewhere in your path.
That's the error message you get if you try to run any executable that's not in your current directory or in the path.
To correct the problem, find the SQLite executable (SQLITE3.EXE), and run it from the directory in which it resides, or add SQLITE3.EXE to your PATH environment variable.
You have to properly set your PATH environment variable to include one of the locations where sqlite3.exe resides. Usually SQLite seems to set that environment variable upon install but the list of paths where you found it indicates that it just came as a library for various other applications. Therefore it's not too surprising that the path isn't set.
I have sqlite3 on my machine, and as others have mentioned it must be located within a folder specified by your PATH environment variable. Since I use it a lot, I threw it in windows\system32, which is where I place a lot of utilities like pstools.

Resources