topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday June 21, 2025, 12:07 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Recent Posts

Pages: prev1 ... 15 16 17 18 19 [20] 21 22 23 24 25 ... 225next
476
General Software Discussion / Re: Windows 10 Announced
« Last post by 4wd on April 02, 2019, 03:58 AM »
"Prevents others from tampering with important security features."

By others they probably mean anyone who isn't Microsoft themselves and that switch is just there as a placebo effect.
477
To get the script to work on my PC I had to do these things
- the multi line comments at the top gave errors, but changing /* and */ to <# and #> fixed that.

Ooops, my bad, I added the comment after pasting into the post ... should've tested it.
I've updated the code/archive.
 
- run the cmd window as administrator
- add the Bypass argument, like so

Wasn't necessary if run from a PowerShell console, even just right-click on the script and choose Run with Powershell but you'd bump up against the ExecutionPolicy restriction - which does get to be a real PITA sometimes.  In theory you can right-click->Properties and select something like Trust this file under the Security tab ... but I haven't seen it for awhile so I may be mis-remembering.

Shouldn't need Admin privileges since you're only writing to a directory that the user owns anyway ... just tried it here, no Admin required, just had to answer '(Y)es' to the ExecutionPolicy question that pops up.

The same task can also be created manually (and deleted if no longer needed) through the Task Scheduler (win+I and search for "schedule tasks").
Not a very end-user friendly way to set this up though.

Perhaps this post which shows setting/deleting a scheduled task in Powershell may help?

Give the task a static name and have the script just check if it's there at each run using schtasks /query <taskname>, implement if it isn't and have an optional argument to the script Apps2Shortcut.ps1 -Remove to remove it if the task is no longer required.
478
Simple Powershell script, it'll create an "Installed-Apps" folder on the Desktop and populate it with shortcuts for installed ... err ... apps.

For this purpose it regards any AUMID that contains a ! and doesn't end in .exe as a valid app - as distinct from every program installed.

Run it from a Powershell console using: .\Apps2Shortcut.ps1

For some reason I couldn't get it to run from a shortcut but that's probably my fault.

You will probably get an error if you run the extracted script from the archive due to Execution Policy, there are 3 solutions:
  • Copy/Paste the script below as a new script
  • Mark the script as trusted, (it has a zone identifier in its ADS which marks it as not from the local machine)
  • Change your Execution Policy using Set-ExecutionPolicy

Standard Disclaimer: Works for me  :)

Code: PowerShell [Select]
  1. <#
  2.   Apps2Shortcut.ps1
  3. #>
  4. Function Create-Shortcut {
  5.   param (
  6.     [string]$name,
  7.     [string]$aumid
  8.   )
  9.   # Create a Shortcut with Windows PowerShell
  10.   $WScriptShell = New-Object -ComObject WScript.Shell
  11.   $Shortcut = $WScriptShell.CreateShortcut($name)
  12.   $Shortcut.TargetPath = "$env:SystemRoot\explorer.exe"
  13.   $Shortcut.Arguments = "shell:Appsfolder\$($aumid)"
  14.   $Shortcut.Save()
  15. }
  16.  
  17. $DesktopPath = [Environment]::GetFolderPath("Desktop")
  18.  
  19. if (!(Test-Path "$($DesktopPath)\Installed-Apps")) {
  20.   New-Item "$($DesktopPath)\Installed-Apps" -ItemType Directory | Out-Null
  21. }
  22.  
  23. $apps = (Get-StartApps)
  24. for ($i = 0; $i -lt $apps.Count; $i++) {
  25.   if (($apps[$i].AppID).contains("!") -and (($apps[$i].AppID).Substring(($apps[$i].AppID).Length - 4) -ne '.exe')) {
  26.     Create-Shortcut "$($DesktopPath)\Installed-Apps\$($apps[$i].Name).lnk" $apps[$i].AppID
  27.   }
  28. }

Hopefully you'll end up with something like this:

2019-04-01 10_38_59.png

To run a Powershell command from AHK you'll probably need to use: powershell.exe -C "Get-StartApps | Out-File D:\test.txt"

Use -C to run commands directly, -F to run a script.
479
General Software Discussion / Re: Listing the unused
« Last post by 4wd on March 30, 2019, 06:57 AM »
List files sorted by Last Access time:

Code: Text [Select]
  1. dir <file spec> /s /od /ta

eg. List all MP3 files on D:\

Code: Text [Select]
  1. d:
  2. cd \
  3. dir *.mp3 /s /od /ta
480
General Software Discussion / Re: youtube downloader?
« Last post by 4wd on March 30, 2019, 06:52 AM »
SlimJet browser and hit the download button.
tnx. free?

Yep

https://www.slimjet.com/
It works! Tnx!
I need a YT banner ad blocker now. =)

SlimJet is based on Chrome sourcecode so try Video Adblocker for Youtube
481
Living Room / Re: Share your photos! Travel shots, photoblogs, etc.
« Last post by 4wd on March 24, 2019, 05:11 AM »
Sunny but bloody cold.
PANO_20190324_094617.jpg
IMG_20190324_092433221_HDR.jpg
482
Living Room / Re: Share your photos! Travel shots, photoblogs, etc.
« Last post by 4wd on March 22, 2019, 01:30 PM »
Brexit got delayed...also...Are you up near Whitby?
-Stephen66515 (March 22, 2019, 12:49 PM)

Yep ... on both counts.

At Staithes for 6 months.
IMG_20170607_130310.jpg
483
Living Room / Re: Share your photos! Travel shots, photoblogs, etc.
« Last post by 4wd on March 22, 2019, 12:39 AM »
IMG_20190321_182747949.jpg

Greetings from the UK, it's Brexit -7 days (+/- nobody knows and probably no longer cares).

Which leads to:
IMG_20190321_175757498.jpg
484
Doesn't Moto have a transfer app?

Not for at least 2 years, out of interest I went looking when I got my G5+

Google's backup of apps/settings is hit or miss, sometimes it works, sometimes it doesn't, sometimes you can't even enable it - which I can't even though It has worked on my current phone previously.

The only 100% working method I've found is unlock the bootloader, install TWRP, root it using Magisk or something else, and then install Titanium Backup + Root - something I've done with every Android device I've ever bought.
485
General Software Discussion / Re: youtube downloader?
« Last post by 4wd on March 19, 2019, 10:09 PM »
SlimJet browser and hit the download button.
tnx. free?

Yep

https://www.slimjet.com/
486
General Software Discussion / Re: youtube downloader?
« Last post by 4wd on March 18, 2019, 01:34 PM »
SlimJet browser and hit the download button.
487
Just need to test for the existence of the output file:

Code: PowerShell [Select]
  1. if (!(Test-Path $outFile)) {
  2. ...
  3. }

Added, try it now, (haven't tested it but it should work).
488
Many thanks again to 4wd for the great help. ;)

Thanks, edited my OP, now does the lot, (.html, .htm, .mht).

Updated
489
I don't know if this is possible but it would be great if the Powershell could exclude converting htm and html files that are smaller than 3ko ?

You already have the answer, same idea as deleting the small PDFs.

Code: PowerShell [Select]
  1. $aFiles = (Get-ChildItem -Include *.html,*.htm -Path ($srcFolder + "*") -Recurse | Where-Object {$_.Length -gt 3kb} )

As for Chrome, I couldn't get it to work from PowerShell either, I'll have another look when I have time.

But you do have the args wrong, should be:
Code: PowerShell [Select]
  1. $args = "`"$($infile)`" --headless --print-to-pdf=`"$($outFile)`""

Just the arguments for the command.

Could try adding a working directory also:

Code: PowerShell [Select]
  1. Start-Process -FilePath "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -Wait -NoNewWindow -ArgumentList $args -WorkingDirectory "C:\Program Files (x86)\Google\Chrome\Application"
490
Added *.htm to the Get-ChildItem filter so no need to edit and run separately, (not tested but works in other scripts - just remove it if there's a problem).

As for .mht, you could use PowerShell to pass them through the IE core to output as PDF ... so goes the theory.

Alternatively, convert to HTML first then run the script, interesting blog post: http://raywoodcocksl...-html-mht-files.html
491
Something quick in PowerShell using wkhtmltopdf, (put the executable in the same directory as the script), and Chrome.

Recursively converts .html, .htm, and .mht to PDF files.

Btw, if it looks familiar, 90% came from here.


Run it from a PoSh console or use a shortcut with the following as the Target, (assuming shortcut in the same folder as the script):
Code: Text [Select]
  1. %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -sta -NoProfile -ExecutionPolicy Bypass -File "CTP.ps1"

CTP.ps1
Code: PowerShell [Select]
  1. <#
  2.   CTP.ps1
  3.  
  4.   Convert .htm(l) and .mht to PDF
  5. #>
  6.  
  7. Function Get-Folder {
  8.   Add-Type -AssemblyName System.Windows.Forms
  9.   $FolderBrowser = New-Object System.Windows.Forms.FolderBrowserDialog
  10.   [void]$FolderBrowser.ShowDialog()
  11.   $temp = $FolderBrowser.SelectedPath
  12.   If($temp -eq '') {Exit}
  13.   Return $temp
  14. }  
  15.  
  16. If($PSVersionTable.PSVersion.Major -lt 3) {
  17.   Write-Host '** Script requires at least Powershell V3 **'
  18. } else {
  19.   Write-Host 'Choose input folder: ' -NoNewline -BackgroundColor DarkGreen -ForegroundColor White
  20.   $srcFolder = (Get-Folder)
  21.   Write-Host $srcFolder
  22.   Write-Host 'Choose output folder: ' -NoNewline -BackgroundColor DarkGreen -ForegroundColor White
  23.   Do {$dstFolder = (Get-Folder)} While($dstFolder -eq $srcFolder)
  24.   Write-Host $dstFolder
  25.  
  26.   # PowerShell doesn't care how many stacked '\' there are in a path, multiples will always be seen as one
  27.   # ie. C:\\\\Windows = C:\Windows
  28.   # Means you can just add to the path without worrying about the trailing character
  29.   # Collect all files bigger than 3kB
  30.   $aFiles = (Get-ChildItem -Include *.html,*.htm,*.mht -Path ($srcFolder + "\*") -Recurse | Where-Object {$_.Length -gt 3kb} )
  31.   for($i = 0; $i -lt $aFiles.Count; $i++) {
  32.     $inFile = [string]$aFiles[$i]
  33. # Substitute destination folder for source folder and tack .pdf on the end
  34. # Could probably replace the extension instead ... but laziness and all that
  35.     $outFile = $dstFolder + $inFile.Replace($srcFolder, "") + '.pdf'
  36. # If output file doesn't exist then process
  37.     if (!(Test-Path $outFile)) {
  38. # Grab the parent of the output file, create the folder structure if it doesn't exist
  39.       $temp = Split-Path $outFile -Parent
  40.       if (!(Test-Path $temp)) {
  41.         New-Item $temp -ItemType Directory | Out-Null
  42.       }
  43.  
  44.       Write-Host 'File:' $inFile -BackgroundColor DarkBlue -ForegroundColor Yellow
  45. # Switch command based on the last 3 characters of the file name, anything that isn't 'mht' gets processed
  46. # as htm(l)
  47.       switch ($inFile.Substring([Math]::Max($inFile.Length - 3, 0))) {
  48.         mht {
  49.           $args = "`"$($inFile)`" --headless --print-to-pdf=`"$($outFile)`""
  50.           Start-Process -FilePath "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -Wait -NoNewWindow -ArgumentList $args
  51.           }
  52.         default {
  53.           $args = "-p 127.0.0.1 -q `"$($inFile)`" `"$($outFile)`""
  54.           Start-Process -FilePath ".\wkhtmltopdf.exe" -Wait -NoNewWindow -ArgumentList $args
  55.           }
  56.       }
  57.     }
  58.   }
  59. }
  60. Write-Host ''
  61. Write-Host 'Close window to exit ...'
  62. cmd /c pause | out-null
492
Living Room / Re: Looking for "Smart"watch Recommendations
« Last post by 4wd on March 06, 2019, 11:40 PM »
Jokes aside, now I gotta go research the bip 2 and see if I need to wait for it or not.

Not really much concrete info available atm just hearsay, speculation, rumours, and wish lists.  The pre-order page that was up is no longer accessible but the specs it had were similar to the BIP1 with the exceptions:
  • 5ATM Water Resistance
  • No Barometric sensor
  • A little narrower

But I'd wait until it appeared on Amazfit's website before taking those as gospel.
493
Living Room / Re: Looking for "Smart"watch Recommendations
« Last post by 4wd on March 06, 2019, 06:19 PM »
Just a couple of notes on the BIP:

  • For the basic stuff nothing other than the supplied app is required, (Mi Fit), so it's fine for Notifications, Step Counter, Heart Rate, Sleep Analysis, etc, etc.
  • The BIP2 is soon to be available, (was available for pre-order for a short time) - 5ATM Water Resistance, slightly narrower, loses the Barometric sensor, albeit at a higher price - but it may prompt sales on the BIP1.

I think Apple has the best Smart Watch.

I'm looking for a smartwatch that won't murder my bank, has good battery life, and that will let me view my [Android] phone's notifications without having to take it out of my pocket.

0 out of 3 ain't that bad ... I guess.
494
Living Room / Re: How to calculate the area of a graph?
« Last post by 4wd on March 06, 2019, 03:42 PM »
http://www.mathwords...ea_under_a_curve.htm

Bearing in mind it's been 40+ years since I had to stare cross-eyed at this stuff I would have thought that since the graph was seemingly created using sampled data rather than a formula that you would have had to use the age old method of slicing and dicing the area into trapezoids, calculating their area, and then adding them together?

Or given the data you could probably just stick it into Excel and have it do it.
495
Found Deals and Discounts / Re: [FREE] Packt Book of the Day
« Last post by 4wd on March 05, 2019, 01:08 AM »
It seems Packt's free learning has had some changes this year.

Now there are free videos instead of just eBooks. :Thmbsup:
But more importantly, now it seems you don't get free downloadable eBooks anymore. You only get HTML access to the books. :down: :'(

Any code examples are still downloadable but I've kind of stopped looking since having to read a book online is a P.I.T.A.

They do have a mobile app though that allows offline reading ... might look at that at some point, (but pretty useless unless I invest in a new tablet with Android 4.4+).
496
Living Room / Re: Is there any compact portable browser?
« Last post by 4wd on March 04, 2019, 07:57 AM »
@Curt: Didn't install it at all: extract to Ram drive, open CLI, execute it, browse web.
497
NOTE: If you already get more than 20GB month DO NOT input the code, it's likely you will be reduced to 20GB/month.

Currently you can get 20GB/month on free accounts at Windscribe with the following code: EXPAND20

To get 20GB you need to sign up and add a verified email address, (which will get you 10GB), then input the voucher code to increase it to 20GB.
498
Had a fool around with EBO for something to do.

2019-03-04 20_57_02-EBO.png
499
Living Room / Re: Is there any compact portable browser?
« Last post by 4wd on March 04, 2019, 03:42 AM »
suggestions?

You didn't mention an OS so I'll assume Windows.

FWIW, on my old 1.5GB Atom powered netbook I used to use either K-Meleon or the XP version of PaleMoon (archive link) which had optimisations for Atom CPUs.

There's a couple of PaleMoon derivatives based on current code but patched for XP: MyPal and Serpent/UXP, (see page 118 for current builds).

Would be tempted to install a lightweight Linux and try Firefox, etc (currently have Bodhi Linux installed on my Atom netbook).
500
Living Room / Re: Is there any compact portable browser?
« Last post by 4wd on March 03, 2019, 05:42 PM »
I recommend just pulling Frederic Meunier's build from here. Lynx only takes about 4mb of disk space.  ;)

Didn't work on my Windows 10 PC (64-bit).

Hm, works on my Win 10 64 bit, I am at 1809.

Works on 1803 also.
Pages: prev1 ... 15 16 17 18 19 [20] 21 22 23 24 25 ... 225next