To print a PDF from the command line using Adobe Reader you just need to prompt one single command into the CMD
> "C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe" /t "path/file.pdf"
The first part specifies the location of Acrobat Reader (AcroRd32.exe), if you don't know where it actually is installed in your computer you can search for it using Windows search.
The second part is /t and it reefers to printing a file suppressing the print dialogue box.
In the third part, the full path of where is the PDF file we want to print.
More info:
http://livedocs.adobe.com/acrobat_sdk/10/Acrobat10_HTMLHelp/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Acrobat10_SDK_HTMLHelp&file=DevFAQ_UnderstandingSDK.22.31.html
I know this is pretty stupid, but I hope I can do something useful with it and create a batch printing solution.
- victor -
Este blog esta dedicado para narrar algunas de las aventuras que tengo mientras aprendo a utilizar algunos programas.
Thursday, September 13, 2012
Thursday, August 23, 2012
Backup My Docs with WINDOWS 7 cmd
I just learned how to copy / paste My Documents folder (or any other) to a new folder named Backup+date and I want to share it.
This is the code:
--------------------------------------
@echo off
echo %time%
echo ### creating backup folder
cd C:\Users\victor\desktop
::md backup_%Date:~-4,4%_%Date:~-10,2%_%Date:~-7,2%
xcopy C:\Users\victor\Documents\* C:\Users\victor\desktop\backup_%Date:~-4,4%_%Date:~-10,2%_%Date:~-7,2% /s /i >> backup_%Date:~-4,4%_%Date:~-10,2%_%Date:~-7,2%.txt
echo Backup Complete!
echo %time%
@pause
-------------------------------------
If you want it, you need to copy this code and paste it in a notepad saving it with a name and with the extension .cmd which is pretty cool because you only need to double click this file to run it, NO need to go to the command line to execute it.
As you can see I mark the time when the script starts and finishes so I know how much time the hole process took.
then I create using "cmd" the backup folder including in its name the date, for now I am just saving the backup folder to the Desktop but really the idea would be creating it directly to an external HDD. I do this because I save a log file with all the doc that were copy from one location to another, but the reality is that xcopy by it self could create the destination folder by pointing the right location.
If you take out the date of the folder then instead of creating multiple backup folders with different dates, you will be overwriting the backup folder which is pretty useful if you only want a single image of your documents.
As you can see it is not rocket science, but I am happy that I was able to do this, now I know that I can write scripts like this for windows to move file around my system.
Vic./
This is the code:
--------------------------------------
@echo off
echo %time%
echo ### creating backup folder
cd C:\Users\victor\desktop
::md backup_%Date:~-4,4%_%Date:~-10,2%_%Date:~-7,2%
xcopy C:\Users\victor\Documents\* C:\Users\victor\desktop\backup_%Date:~-4,4%_%Date:~-10,2%_%Date:~-7,2% /s /i >> backup_%Date:~-4,4%_%Date:~-10,2%_%Date:~-7,2%.txt
echo Backup Complete!
echo %time%
@pause
-------------------------------------
If you want it, you need to copy this code and paste it in a notepad saving it with a name and with the extension .cmd which is pretty cool because you only need to double click this file to run it, NO need to go to the command line to execute it.
As you can see I mark the time when the script starts and finishes so I know how much time the hole process took.
then I create using "cmd" the backup folder including in its name the date, for now I am just saving the backup folder to the Desktop but really the idea would be creating it directly to an external HDD. I do this because I save a log file with all the doc that were copy from one location to another, but the reality is that xcopy by it self could create the destination folder by pointing the right location.
If you take out the date of the folder then instead of creating multiple backup folders with different dates, you will be overwriting the backup folder which is pretty useful if you only want a single image of your documents.
As you can see it is not rocket science, but I am happy that I was able to do this, now I know that I can write scripts like this for windows to move file around my system.
Vic./
Saturday, June 02, 2012
Compiling a C++ (.cpp) program on the command line of Windows 7 (cmd.exe).
If you are new to this matter like me, and you don't want to use the crap that Microsoft Visual Studio has to offer then follow these simple steps, and you'll be able to write and compile your own programs using notepad or, I strongly recommend using, notepad++. I am writing this because this steps worked well for me in my Windows 7 machine, and I want to keep a record of what I did today and maybe someone one day might read this and find this information useful.
1.- Download and install MinGw I, downloaded the automated version which is basically an already compiled ready to use .exe (If you like it hard, then you can download the files and compile them your self) from this web page: http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/mingw-get-inst-20120426/ (maybe a new version has been released you I encourage you to check that out).
2.- Download the file and follow the installation instructions, they are not hard to follow. I did the installation of the files directly in my C:\ drive to save some kind of confusion latter on.
Now you need to specify the path where g++ (which is the compiler I'm going to use) has been installed to the command line (cmd.exe).
3.- Open cmd.exe and type the following and then hit ENTER.
set PATH=%PATH%;C:\MinGw\bin
Remember I am using C:\MinGw\bin because that is the location where I installed MinGW, you might have use other one.
Now you can test if this works by writing a simple C++ program on your notepad.exe and save it as NAME.cpp, in your Documents folder it may be something like:
------------
# include
using namespace std;
int main()
{
cout << "this is stupid";
return 0;
}
------------
Now on the command line (cmd.exe) go to your Documents folder (cd C:\Users\victor\Documents) and see that your file NAME.cpp is actually there by typing DIR (which will show a list of all the files and folders that exist in the Documents folder).
Now the exiting part:
COMPILE your file using the following instructions:
g++.exe "NAME.cpp" -o "NAME.exe"
you will see that an exe file has been created called NAME
and if you write NAME.exe on the command line it will say "this is stupid"
Well that was it. I hope this has been useful to you as it was for me...
Regards.
Location:
Brisbane QLD, Australia
Subscribe to:
Comments (Atom)