Showing posts with label Batch. Show all posts
Showing posts with label Batch. Show all posts

January 27, 2021

Windows Batch File - Embed Image (Base64 Encoded) in HTML Code

 Hi folks,

Today I am going to explain how we can add an image to the HTML code in without copying the images in relative path folder.

Procedure

  • Prefix file contents.
    • <img src="data:image/png;base64,
  •  Batch file contents.
  • Suffix file contents.
    • " alt="PSR" />
  • Download the batch file.
  • Open command prompt in Windows.
  • Navigate to the batch file contained folder.
  • Execute the batch file image file name as parameter.
    • > Image2Base64ImgTag.bat PSRImage.jpeg
  • You should see a file "imageTag.html".
  • Open the file to see image in a browser.
  • Open the file with notepad to see the image converted to base64 with proper HTML Image tag.


Hope this helps you to reduce lot of efforts in maintaining the image files/folders.

Send your feedback and comments to psrdotcom@gmail.com

August 08, 2019

Truecrypt Mount and Unmount in Windows

Hi friends,

I would like to share the information of mounting and unmounting truecrypt in windows

Please find the batch file here

https://gist.github.com/psrdotcom/8350f1469a7a396a886e86b3f29ef38a#file-truecryptmountunmount-bat

With the above batch file, you should be able to do following functionalities

1. Mount a folder as drive
2. Unmount the drive

Hope, this information is useful to you.

Please send your comments and feedback to psrdotcom@gmail.com




October 31, 2014

Change IP Address and DNS from static to DHCP and vice versa in Windows Command Line Dynamically using Batch file script

Hi friends,

I was frequently changing my system network from static to dynamic.

I was fed-up with the manual changes by entering the static IP address and changing it to dynamic.

I though of creating a batch file, which requests user to select options and proceed further.

 

I found something on Internet, just modified it for my purpose and thought of sharing with you all.

 

  • Check your network name
    • cmd> netsh interface show interface
  • It will list all the network interfaces connected to your system
    • Select the network which you want to change the settings
  • Modify the below code with appropriate network name, IP address, subnet, gateway and DNS server

@echo off

set NETWORK="Local Area Connection"
set IP=10.9.40.95
set SUBNET=255.255.255.0
set GATEWAY=10.9.40.47
set DNSSERVER=192.168.178.1

echo Choose:
echo [S] Set Static IP
echo [D] Set DHCP
echo.

:choice
SET /P C=[S,D]?
for %%? in (S) do if /I "%C%"=="%%?" goto S
for %%? in (D) do if /I "%C%"=="%%?" goto D
goto choice

:S
@echo off
echo "Setting Static IP Address, Subnet Mask and DNS Server"
netsh interface ip set address %NETWORK% static %IP% %SUBNET% %GATEWAY% 1
netsh interface ip set dnsservers %NETWORK% static %DNSSERVER% primary
netsh interface ip show config
pause
goto end

:D
@echo off
echo "Resetting IP Address, Subnet Mask and DNS server For DHCP"
netsh interface ip set address name=%NETWORK% dhcp
netsh interface ip set dns %NETWORK% dhcp
ipconfig /renew

echo "New IP Address, Subnet Mast and DNS Server for %computername%:"
netsh interface ip show config
pause
goto end

:end

Now enjoy the feature of changing IP address with 3 clicks

 

Please send your feedback and comments to psrdotcom@gmail.com

Blogger Labels: Change,DHCP,vice,Windows,Command,Line,Batch,script,system,user,options,Internet,purpose,Check,interface,interfaces,Select,settings,Modify,gateway,server,NETWORK,Local,Area,Connection,SUBNET,DNSSERVER,Choose,Static,Mask,Mast,feedback,netsh,goto,config

December 19, 2011

Converting Power Point Presentation (PPT) to Images and Conversion of Images to PPT

Hi all,
Today I was searching for converting the slideshow to images and doing some batch processing to the images like crop, resize, filename change and again making ppt with the modified images.

I followed the below procedure to convert my slides in ppt to images, cropping the images and finally making slideshow with edited images.
  • Converting slides to images
    1. (MS Office 2007) Office Button (Top-Left) -> Save As ->  Other Formats
    2. Choose the corresponding destination folder
    3. Choose "Save as type" as "JPEG File Interchange Format (*.jpg)"
    4. One pop-up comes with the following options
      • Every Slide: This option saves every slide to an individual image
      • Current Slide: This option saves only the current slide to an image
    5. Choose relevant option to you
  • Batch Processing the images
    1. I have seen one video from youtube and I was impressed with the Irfan View working with batch processing of images
    2. Please see the below video and do the batch processing of images
  • Uploading images to PPT
    1. (MS Office 2007) Click on "Insert" tab and select "Photo Album" -> "New Photo Album"
    2. Select the image(s), which you would like to add in the presentation.
This kind of approach makes our lives easy.


If you have any queries, please mail to psrdotcom@gmail.com

Featured Post

Java Introdcution

Please send your review and feedback to psrdotcom@gmail.com