Friday, January 10, 2014

Linux printing from Dropbox folder

Tomorrow is a mystery

This time it has worked!

#!/bin/bash

set PrintQueue="/home/nick/Dropbox/Print"

IFS=$'\n' for PrintFile in $(/bin/ls -1 ${PrintQueue}) do lpr -r ${PrintQueue}/${PrintFile}; done

Saturday, August 27, 2011

Batch Script to rename VirtualBox vdi files

@echo off
color 01

:start
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: variables ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

set com_run="C:\Program Files\Oracle\VirtualBox\VBoxManage.exe"
set com_opt=clonevdi
set src_dir="%homepath%\VirtualBox VMs\"

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: script starting ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

if exist %src_dir% (
goto next1
) else (
goto next2
)

:next1
dir %src_dir% /B /S

echo ---------------------------------------------------------------------------------------
echo ---------------------------------------------------------------------------------------
set /P old_vdi="( Enter old vdi name: ) "
echo.
echo.
set /P new_vdi="( Enter new vdi name: ) "
echo.
echo.
echo This will take a while
echo.
echo please wait...
ping -n 4 127.0.0.1 >NUL
%com_run% %com_opt% %old_vdi% %new_vdi%
goto next2

:next2
echo You screwed up again......somewhere.....
goto end
::goto end
:end
pause