The command prompt is alive and well in Citrix Winframe and Metaframe, it is often faster and more efficient to do things from it than from winstation administration. Below are some great helps to make it even more efficient for you.
===========================================================================The text between the double lines is what you type at the command prompt to create the files. Here is the most useful one we have it is called Killall.bat all you need to do is type killall followed by the workstation id numbers you want to reset ex: killall 21 22 23 24. This works great if you need to log multiple users off to fix a problem.
Copy con killall.bat @echo off cls :killanother if <%1>==<> goto alldead reset winsta /v %1 shift goto killanother :alldead================
press control-z to save the file
================We created these two batch files to quickly disable and reenable logons. We created an Icon from the batch files. and added it to our admin group. You can omit the Rem lines.
===================Copy con disable.bat Rem This command disables logons change winsta /disable====================
press ctrl-z to save the file
====================Copy con enable.bat Rem This command enables logons change winsta /enable================
press ctrl-z to save the file
==================S.bat was created to get a status of another server from any of our servers. Our servers are named Citrix1 - Citrix5 You will need to substitute your server names for the word Citrix. You would type s and then the server number ex. s 1. Hopefully your server names are sequentially numbered or this wont work.
Copy con s.bat @echo off cls quser /server:CITRIX%1 if CITRIX(%1).==CITRIX(). goto end :end===========================
press ctrl-z to save this file
=========================================================Deltree.bat is a batch file I found on the web to solve a major problem with NT. We needed a way to delete all files within a subdirectory without deleting the directory itself, and also avoid having to answer y a million times. The deltree command is gone in NT so this is the way around it. We use this to clear our Temp Directory as well as delete and recopy program subdirectorys when files get corrupted. The command is such you would type deltree then the drive and directory you want to delete for example deltree c:/temp
==================================================
Copy Con Deltree.bat
@echo off
pushd %1
del /q *.*
for /f "Tokens=*" %%i in ('dir /B') do rd /s /q /a "%%i"
popd
=================================================
press ctrl-z to save this file
Another simpler way to delete all files from a subdirectory but it takes up two lines in your batch file is to use the below two lines:
echo y | del c:\temp\*.* /S rd c:\temp\ /s /q md c:\temp Cacls C:\TEMP /E /P EveryOne:F
The first line clears out the files in the root and all subdirectories(/s)without prompting, the second line deletes the subdirectory folders. Make sure you have the \ at the end of the directory name on the second line or it will delete the directory also. Sometimes this command deletes the temp directory. Thus the md statement to recreate it. It is ignored if the directory exists. The cacls command gives everyone full permission to write to the temp directory in case someone accidently took permission of it.
Pro.bat was written to view the running processes on the system you are on. We have found that a process stuck in the run state for a long period of time is usually a runaway and killing that process will bring a server back to life.
============================copy con Pro.bat qprocess * |more============================
press ctrl-z to save this file
P.bat took pro.bat one step further it gave us the ability to look at processes on our other servers. Just by typing in P and the number of the server. Ex. P 1. Note like s.bat that you have to substitute the word Citrix with the name/number of your server and hopefully they are sequentially numbered.
@echo off cls qprocess * /server:CITRIX%1 if CITRIX(%1).==CITRIX(). goto end :end=============================
press ctrl-z to save this file
For a batch file on how to reset hung print jobs see my page at: Printers.cfm
Disclaimer: This information is supplied as is and is intended for information purposes only. Use this information at your own risk. The internet can often contain false or misleading information. While this is generally not the case with my personal documents I have to put this text here for legal purposes.
Discuss your Terminal Services & Citrix issues with thousands of other SBC experts. Click here to join!