Wednesday 26 August 2015

PDFtk Burst PDF in a Windows Command Prompt (Batch File)

I had a user at work who needed to expand PDF files into their individual pages. 
This is the solution I came up with, using PDFtk and a bit of cmd script.
It creates files in a sub folder called output, so make sure that exists before you try and run it.

<code>
@echo off
setlocal EnableDelayedExpansion
set "source=%~dp0"
set "name=%1"

IF DEFINED name (
 call :burst %name%
 ) else (
 call :usage
 )
goto :xit

:burst
 set "file=%~nx1"
 echo Working on %file%
 for /f "skip=1" %%x in ('wmic os get localdatetime') do if not defined mydate set mydate=%%x
 SET "mytime=%mydate:~0,14%"
 pdftk %name% burst output "%source%output\%file%_%mytime%_%%04d.pdf"
 for %%d in (%source%output\doc_data.txt) do del %%d
 echo Done!
 goto :EOF

:usage
echo Nothing to do... drag a file onto me!
goto :EOF

:xit
endlocal
timeout /T 3
<\code>

Friday 27 February 2015

Acer BSOD 0x000000F4 after SSD Upgrade

BSOD 0x000000F4 picture

Today a colleague presented me with his Acer laptop and the BSOD pictured above. (0x000000F4)
It's a couple of years old (20011?) and was recently upgraded with a Crucial MX100 SSD and 8GB of Crucial RAM.

It had never exhibited this error prior to the memory or SSD upgrade, so I was less than amused by the situation, especially since the SSD was not accessible without powering off the machine, leaving me with no Dump File to check.

After much testing, it transpired that it would only crash when on battery power, and never in Safe Mode. This led me to look at the drivers which were loaded during a "normal" boot.
After a bit of trial and error, upgrading the Intel drivers etc, I uninstalled the Acer Power Management software. This has resolved the issue and the laptop will now transition between mains and battery power just fine.


Wednesday 28 January 2015

remote desktop gateway server is temporarily unavailable

I've been playing with RD Web this week, and was getting the following error when attempting to Connect to a remote PC - "remote desktop gateway server is temporarily unavailable" on my Server 2012 R2 test rig.

I'm able to use Remote Desktop Connection if I manually specify my gateway server settings. 
After much Googling it occurred to me that it could be because I'm running my RDWeb server on an unusual external port. I've already had to configure the HTTP and UDP Transport settings to match my bespoke port (RD Gateway Manager properties), so I drilled down into the Application Settings in IIS Manager and added :PORT# to the end of my FQDN in the DefaultTSGateway field.

I've ended up with something along the lines of:    rdw.domain.com:1234

This subtle change (after a refresh of the REWeb portal in the browser) seems to have done the trick.