CJSmith dot me

I dump stuff I find useful here

Author: Chris Smith

Amend an SCCM NTFS USB flash drive for the Microsoft Surface 3 (Non Pro)

Published / by Chris Smith / Leave a Comment

Microsoft Surface 3’s for some reason don’t support mounting USB Flash drives mounted as NTFS from its UEFI/BIOS and have to be FAT32.
Either reformat the USB flash drive as Fat32 and copy back the image (Windows Command Line currently only supports FAT32 to NTFS conversion, not the other way around), third party software needs to be used to keep data in place such as Rufus. This was also recommended by the IT shared service centre where I work and worked perfectly for every Surface 3 device we had.

With a faulty drive stop Windows from mounting

Published / by Chris Smith / Leave a Comment

Credit: A Video from Linus Tech Tips reminded me of a way to stop Windows 7/10 from automounting drives

If you have an issue with a hard drive (That is spinning up, doesn’t sound like its head is craching/clicking and a SMART tool like CrystalDiskInfo Standard edition shows its healthy) that simply appears to hang your machine/take forever to mount, Windows can annoy you by attempting to mount drives. Windows can be told not to mount new drives so it can be told to not mount and forget older external drives which were plugged in.
This is useful if you want to drive and image the drive with software (If you don’t have a stand alone duplicator).

Autoscrub disable means you don’t have to modify the windows registry.
Automount scrub means you don’t have to remove the device from device manager (Often a pain with lots of external drives)

Obviously afterwards re-enable to restore default functionality

Georgia Telnet or SSH generate a list of users for GS_L_User.txt

Published / by Chris Smith / Leave a Comment

Georgia Telnet can restrict the number of users that connect to Telnet or SSH.
I am lazy so I tend to generate a list based off our user logon scripts folders, however I do of course take a backup and test it afterwards.

Additional information:
Georgia Telnet Manual and Logon Features

Creating a shortcut to a non existent location on Windows

Published / by Chris Smith / Leave a Comment

Credit: ServerFault
Credit: Craig Tolley
I came across the need to create a shortcut to a non existent file share (Where a wireless network had a different ip range on a different site). I thought Windows would let shortcuts for SMB shares be created if they didn’t exist, but Windows 10 insisted the share had to exist before being created.
ServerFault has a nice little VBS script (Although it created the shortcut, when run it didn’t close the Microsoft Script Host program. I just closed the command prompt window after)

The forum post shows it has been run on Windows 7, I have run this on Windows 10 Enterprise 64 Bit 1607 and created the shortcut on the desktop

After finding another use for the code I ran into an issue adding parameters to the shortcuts.
I wasn’t aware “Arguments” can be used, Craig Tolley has a nice post on how it is used.

Disable Word Press from allowing saving of the username and password from the login screen

Published / by Chris Smith / Leave a Comment

A plugin which isn’t in the Word Press list of available plugins is one I find very handy from Benjamin Uzelac.
It disables Word Press from allowing the browser to save the username and password and that’s it.
Its good for complying with the usual website tests, which flag saving a username and password as a high vulnerability (Like Qualys).
For some reason it states Author “Nobody” and was applied by a third party agency. The author has a file to download in the comments as well in their link below (I recommend using this ratheer than below, I just want to keep it in case it disappears).

Link: Benjamin Uzelac
Its simply create a folder in the plugin directy like “disable-login-autocomplete”, create a php file with a name like “disable-login-autocomplete.php” and copy the code from below, upload it to the plugin folder.

Use T-Sql to find triggers on specific database

Published / by Chris Smith / Leave a Comment

Credit: Joe Stefanelli on Stack Overflow

I wanted a simple way to find triggers on a specific database, Joe Stefanelli posted SQL which did exactly what I wanted.

Display the old USB Device Removal Tab

Published / by Chris Smith / Leave a Comment

Credit:
Waseemulla S on Microsoft Answers

I had a USB device that I could not unload, I prefer the old dialog box anyway and found it is still possible to show this box in Windows 10. The forum post above has the answer, however according to someone was a very poor answer. For me the answer from “Waseemulla S” worked exactly as expected, it was then I found the USB Caddy I had plugged in didn’t support stopping the USB device in this way. Waseemulla S’s steps are below (I see no need to change it)

Create a batch file that will prompt you to “Safe to remove Hardware” with just a click.
Open notepad and type

Click save as and change file type to all files, type the file name Filename.bat (Where Filename is the name of your choice)
Double click the file anytime you want to get “Safe to remove Hardware” prompt.

Batch script to help with launching files for correct version of Windows

Published / by Chris Smith / Leave a Comment

We encountered an issue during a migration to Windows 10 where I had missed a program which had hard coded links, these no longer worked due to Microsoft Access being a newer version.
I generated a simple script so we could change the hard coded links to allow it to select the correct version, all we do is call the script and add the access filename. It only handles Windows 7 and 10, but you can easily add you own section before goto sub_wrongos by using version numbers from MSDN. It can also be amended to launch something else.
I used start instead of call or simply the command line as this would leave the Windows Command Prompt window in the background until the application it launched was closed.
This isn’t ideal and meant to be temporary, so when fully migrated we will hard code them back to our Office 2016 versions of Access Front ends.

Generate a text file with subfolders in a location on explorer

Published / by Chris Smith / Leave a Comment

I needed to generate a list of folders and their subfolders, I used a simple command for dir command and slapped into a text file.
Below replaced with the folder you want to get the list from (i.e C:\Users\Default) and replace with where you want to save a textfile (i.e C:\textfile.txt).

Credit: SS64

Find unused MSSQL indexs on a database

Published / by Chris Smith / Leave a Comment

Credit: Basit’s SQL Server Tips

The following is very handy to check for any unused index’s on a MSSQL database, this should only be run once the database has been up for at least a week or when all scheculed jobs have been allowed to run at least once. The only change I made is to display the table and index name.