Skip to content

Instantly share code, notes, and snippets.

View paveljurca's full-sized avatar
🎯
Focusing

Pavel paveljurca

🎯
Focusing
View GitHub Profile
@paveljurca
paveljurca / gist:322104f6964c479332edaccc64b38aac
Last active August 17, 2017 10:43
windows account type changed to BACKUP

The User Profile Service failed the logon

user profile status suddenly changed from "Local" to "Backing"

Run sysdm.cpl to access the local saved user profiles dialog.

tries to load from C:\Windows\System32\config\systemprofile\ and says Desktop doesn't exist

HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileList

@paveljurca
paveljurca / AUTOEXEC.BAT
Last active July 20, 2017 18:27
CMD always show all files
@PATH %USERPROFILE%\bin

MSI GUID

64bit

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

32bit

HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

@paveljurca
paveljurca / mkuser.sh
Last active July 20, 2017 14:26
make user
#!/bin/sh
LOGIN=$0
NAME=$1
read PASS
# useradd won't create home directory from /etc/skel unless using the -m option
# TIP: adduser is an interactive Perl frontend around useradd
useradd -u $ID -g 100 -c "$NAME,,," -m $LOGIN -n
@echo off
REM Can I SUDO?
type nul>>%systemdrive%\sudo 2>NUL: || msg %username% "ERR: Must run as administrator"
REM ====== UNINSTALL =====
MsiExec.exe /q /X{0FBCC987-1B91-4946-91E5-B985A925505E}^
&& echo Mediasite Search REMOVED
REM /persistent DOES NOT save credentials, /savecred DOES (don't use it on the command line)
@net use X: \\host\data PASSWORD /user:host\USER
@paveljurca
paveljurca / sudo.bat
Last active July 20, 2017 19:14
Can I SUDO?
REM CAN I SUDO?
rem @TODO: error messages get through, why?
type nul>>%systemdrive%\sudo 2>nul: || msg %username% "ERR: Must run as administrator"
REM running as admin....

IIS FTP Server

FTP clients may fail to work with the IIS FTP built-in server.

mismatched SYST response,

ftp> quote SYST 215 Windows_NT

Seems client expects WINDOWS-NT string and gets Windows_NT.

@echo off
set $dir=%~1
set $regex=%~2
IF NOT DEFINED $regex set $regex=%$dir% & set $dir=.
dir "%$dir%" /b/s/a:|findstr /r /i "%$regex%"
sub ms32_vbs_filedialog {
# let's just see if it works
my $VBScript =<<'EOF';
Set shell = CreateObject("Shell.Application")
Set mediasite = shell.BrowseForFolder(0, "Pick up your Mediasite presentation folder", 0, "%USERPROFILE%")
WScript.Echo """" & mediasite.self.Path & """"
EOF