Archive for the ‘Scripting’ Category

Citrix ChangeUser Mode Batch Script

Citrix
I wrote this to assist the helpdesk at my work for when they install something or make changes to our Citrix enviroment. We have been using it for a long time and thought I would share, plus its always a good reference of how to use “choice” in bat files. What this does is first check for admin rights and if admin rights are found then queries the current mode. It then offers 4 choices, 1 – Install mode, 2 – Execute mode, 3 – Cancel and Exit, and 4 – Query Current...

KixStart Macros

KiXtart Macros KiXtart macros can be used in your script configuration anywhere an expression is expected. During logon, these macros expand into values based on their definition. For example, when a user named Bob logs on to a client machine, the @userid macro expands into Bob. KiXtart macros have many practical uses. The UNC path, \\your-server\@userid, can be used to map a drive to a per-user share. The @lserver macro can be used to set the system time on legacy clients from the authenticating...

Delete Files Remotely Using PowerShell Script

powershell1
To run this with out reading a list just remove the commands at the the bottom and replace the “$_” with computer name or replace the $file variable with local path. Admin rights on the remote computers will be needed and proper permission to access and delete the files. Computers.txt should have only one computer name perline. 123456789101112131415#MAIN function delete-remotefile {     PROCESS {                 $file = "\\$_\c$\File_to_be_deleted.txt"...

AutoIT script to check if file exist then install application

Autoitlogo
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596;========================================================================== ; ; NAME: outlook_addon.au3 ; ; AUTHOR: John Sorensen ; ; COMMENT: ; Install an outlook 2003 specific addon using AutoIT. ;This will first check to see if the addon ; already exists and if not will check if outlook 2003 ;exexcutable exest...

Run DOS command in VBscript

vbscript_icon
DOS command can be run in Vb Script using the Shell object The below script runs a mkdir command through Vb Script Set objShell = CreateObject(“WScript.Shell”) objShell.Run “%comspec% /c mkdir dir1″

Delete a Windows Service

It is rare to have to manually remove a Windows service but on there are times when it is necasarry, like after a bad uninstall or testing beta software. I personally use 1 of 2 methods to remove a service. Prior to removing any service make sure that it is atleast stopped and better yet disabled. Also make a note on the executable path so that it may be removed after the service is deleted. First Method: Open command prompt and use the “sc” command. in this case we want to delete a...

AutoIT Example – FileExist checking and write to file for logging

12345678910111213141516171819202122232425262728;========================================================================== ; ; NAME: write to file example ; AUTHOR: John Sorensen ; ; COMMENT: login autoIT script/snippet to check for file and log if exists ; ;========================================================================== ;check if file exists, if so then  log and exit If FileExists(@ProgramFilesDir & "\program\someprogram") Then   $PCName = @ComputerName $file...

VBscript – Create Folders from Excel

1234567891011121314151617181920212223242526272829303132'======================================================== ' ' NAME: FolderFromExcel.vbs ' ' COMMENT:  Script will read Excel file.  Column A should contain '                  folder names. Folders will then be created. ' '======================================================== Dim objExcel, strPathExcel,strCN Dim objFile, intRow Set objFSO = CreateObject("Scripting.FileSystemObject") Set...
Twitter Delicious Facebook Digg Stumbleupon Favorites More
323 queries in 4.061 seconds.