09 February 2016
How to run an application as a different user
runas /user:[domain]\[user account] "C:\Program Files (x86)\Internet Explorer\iexplore.exe \"[URL]\""
You can use the runas command to run any application you like, just substitute the values above.
Also note that doing as above will prompt you for your password when you run it, so it is best for interactive use. You can store your password in the batch script, but I would not recommend this.
15 October 2015
Restarting Windows XP Mode Virtual Machine via script
The way to resolve this is to reboot the VM, but this is a huge pain in the butt when you have to get VNC access to a machine and run through the whole process of launching the VM and restarting it, so I made some scripts to make my life a bit easier.
Please note that you require administrator privileges on the remote system in order to execute these scripts. You could modify them to include username and password if required. The Virtual machine also needs to be running, so ask the user to open the app that is giving them issues and execute the deploy script. The user can then goto C:\scripts and run the resart-vm.bat file to restart the VM on their machine. This saves me a ton of time and I hope you find it useful.
Scripts list:
| restart-vm.ps1 | Powershell script that restarts the Virtual machine. |
| restart-vm.bat | Batch script to execute the powershell script. |
| deploy-restart-vm.bat | Script copies the files to the remote system C:\Scripts directory. Allows input of host name. |
restart-vm.ps1
$vpc = New-Object -ComObject "virtualpc.application"
$vm = $vpc.FindVirtualMachine("Windows XP Mode")
$vm.GuestOS.ShutDown("true")
restart-vm.bat:
powershell -ExecutionPolicy ByPass -File C:\Scripts\restart-vm.ps1
deploy-restart-vm.bat:
@echo off
cls
echo.
echo Deploy shutdown-vm script to remote host.
echo -----------------------------------------
echo.
set /p host="Please enter host name: "
cls
echo.
echo Deploy shutdown-vm script to remote host.
echo -----------------------------------------
echo remote host: %host%
echo.
echo.
echo Making directory on remote machine
echo.
md \\%host%\c$\scripts
echo.
echo Copying files to remote host
echo.
xcopy /Y C:\Scripts\Deploy\restart-vm\restart-vm.* \\%host%\c$\scripts
echo.
pause
16 July 2009
AutoRuns
Ever wondered why your computer is taking forever to start up? Well then AutoRuns is for you! This is the most comprehensive application that I have seen for killing automatic processes. I think I am going to be using AutoRuns a lot in future! I love sysinternals!
14 July 2009
Sending Emails From CMD
I was recently asked to write a script to check if a file exists and then email someone if the file is found. I found this program called Blat. Blat is a command line email client. basically all I did to get it working was download and copy blat.exe and blat.dll to %SystemRoot%\System32.
Check the code below:
@ECHO OFF
REM ### CONFiGuRE SETTINGS HERE ################
set SMTPServer=127.0.0.1
set ToAddress=email@mydoamin.com
set fromAddress=email@mydomain.com
set Servername=My Server Name
set find="C:\myfile.txt"
REM #####################################
IF EXIST %find% (goto senderror)
goto end
:senderror
set Subject=File Found
set MessageBody=%ServerName% -File Found. (%Date%)
%SystemRoot%\System32\blat.exe -server %SMTPServer% -f %fromAddress% -to %ToAddress% -subject "%ServerName% - %Subject%" -body "%MessageBody%"
goto end
:end
@ECHO ON
11 June 2009
Windows Vista SP2
04 February 2009
Microsoft Doing it Again with Windows 7?
03 December 2008
Vista SP2 on its way!
20 March 2008
Windows Vista SP1
The download weighs in at a pretty heft 434.5 MB. So beware the cap.
The Service Pack does not seem to be available yet via WSUS.
Apparently the Windows Update version of the update will weigh in at only about 65MBfor the x86 version and 125Mb for the x64.
I am waiting to see what the WSUS download is going to do to my cap!
And then there is still Windows XP SP3 which should be out some time soon too!
Ah Telkom, you are going to make some money this month!
26 May 2007
WSUS 3
The Benefits of WSUS
- Save bandwidth, because only one machine downloads your updates and distributes them instead of each computer downloading updates individually.
- Save Time, because you manage all of your computers from one place instead of going from computer to computer.
- Better Security, with WSUS your control over the updates will be vastly improved and therefore your network will be more secure.
- MMC console instead of Web interface
- Better reporting tools
- More options and settings
- You can't sync a WSUS3 Server with a WSUS2 server
- The MMC console is terribly slow over a WAN connection.
- There is no web interface, so you have to install the MMC snap-in and the Microsoft Reporting tool in order to manage your server from another computer.