Decrypting encrypted 7zip archieve file using 7zip command-line utility - command-line

I have a text file myfile.txt which I encrypt using 7zip GUI Tool. So that it generates an encrypted archive myfile.7z
Now, my question is, how can I decrypt this file using 7za.exe command line tool and not the GUI tool. I need to add this functionality in my code to be able to decrypt files using 7zip command line exe, please tell me what is the command to decrypt this myfile.7z encrypted archive using 7zip command line tool?

well finally i figured it out. Using something like this would work:

Related

How to protect the executable perl files from PAR::Packer?

I have created an executable Perl script file using the below command.
pp -x -o output.exe test.pl
The exe file was successfully generated. But when I extract the file using the below command I am able to see the source code.
unzip output.exe
Here I want to protect my Perl script. Even when I extract the file using PAR::Packer that should ask password to extract the file.
Please suggest your views on this.
Thanks in advance.

Run a script via FTP connection from PowerShell

I have made a script that does a really basic task, it connects to a remote FTP site, retrieves XML files and deletes them afterward.
The only problem is that in the past we lost files because they were added when the delete statement was run.
open ftp.site.com
username
password
cd Out
lcd "E:\FTP\Site"
mget *.XML
mdel *.XML
bye
To prevent this from happening, we want to put a script on the FTP server (rename-files.ps1). The script will rename the *.xml files to *.xml.copy.
The only thing is I have no clue how to run the script through my FTP connection.
Some, but very few, FTP servers support SITE EXEC command. In the very rare case that your FTP server does support it, you can use:
quote SITE EXEC powershell rename-files.ps1
Though, in most cases, you cannot execute anything on the FTP server, if FTP is the only way you can access the server. You would have to use another method to execute the script, like SSH, PowerShell Remoting, etc.
But your problem has other solutions:
rename files using FTP; or
delete only the files that were downloaded.
Both are doable, but you will need better FTP client than Windows ftp.exe.
See for example A WinSCP script to download, rename, and move files.
Or you can do it like:
Run ftp.exe once to retrieve list of files;
Process the list in PowerShell to generate an ftp script with get and del commands for specific files (without wildcard);
Run ftp.exe again with generated script.
Actually you do not need to use ftp.exe in PowerShell. .NET assembly has its own FTP implementation: FtpWebRequest.

Create and edit .cpp file in command line

I've been trying to setup Notepad++ with my school's computer lab so that I can access their compiler remotely and write C++ scripts in the application, but so far I've only managed to connect to my student server through PuTTY.
I can access all of my files on my account through command line however, and was wondering if there was a method to create and edit .cpp files in command line.
Thanks in advance.
Yes just make a folder like this:
mkdir myCode
Then create the text file and write it with vim (or nano if you find vim hard):
vi myCode/main.cpp
or
nano myCode/main.cpp

copy command syntax error in Windows XP

Basically I am just trying to create a batch file to copy one file from one location to another location in Windows XP like the code below but failed. May I know why?
copy C:/Directory_A/the_file D:/Directory_B
When I execute the batch file I see this in the output:
The syntax of the command is incorrect.
Try using backslashes
copy C:\Directory_A\the_file D:\Directory_B

Send data to putty in powershell

I have powershell script that open putty.exe in process and i want to send data to this process, how can i do that???
PLEASE HELP!
The process:
$solExe = [diagnostics.process]::start("putty.exe", "-raw -P 2000 127.0.0.1")
The command line interface for putty is plink.exe. You can use plink to send commands over ssh.
For example:
PS C:> c:\progra~2\putty\plink.exe -i C:\credentials\mykeyfile.ppk root#myserver.com "ls";
Things to remember:
The first time you connect to a server, you'll have to add it to your registry, so this won't work in a non-interactive mode for brand new servers. There isn't a way to disable this.
The key file has to be in ppk format for plink.exe to recognize it. If yours is in pem format, use puttygen.exe to create a ppk file.
The path to the key file cannot contain any spaces, or the command above won't work.
If you want to send multiple commands at once, write them to a file and use the -m switch with plink.exe.
If you need to transfer files, you can use pscp.exe in a similar fashion.