add to Runas command

I tried adding some more functionality to the batch file below with no
success.
Is there a way that I can add to this batch file?

For example, color 1f and loading some macros would be great too.

Thanks.

runas.exe /user:Administrator cmd.exe
0
Mint
6/1/2010 10:42:13 PM
windowsxp.general 3897 articles. 1 followers. Follow

1 Replies
928 Views

Similar Articles

[PageSpeed] 9

Below is an example batch file (incorporating the command you quoted ) I 
have working on my system to add some helpful stuff to a new "cmd" 
window....

*NB Make sure the batch-file is named ADMCMD.BAT and is in the system's 
"path" (i.e.; in a folder included in the PATH variable, usually C:\WINDOWS 
is one) and that the file containing the macros is named ADMIN.MAC and is 
[also] placed in C:\WINDOWS.


ADMCMD.BAT
------------------- copy between lines -(start)------------------

@echo off
if %1]==start] goto BATCH
runas.exe /user:Administrator cmd.exe /k call admcmd.bat start
goto :EOF

:BATCH
SET DIRCMD=/A /O /P /X
PATH=%path%;C:\WINDOWS\COMMAND
DOSKEY /INSERT /MACROFILE=C:\WINDOWS\ADMIN.MAC
COLOR 0B
CLS
VER
echo.

------------------- copy between lines -(end)-------------------

The first line "@echo off" prevents the commands from being displayed 
[echoed] on the screen as they are executed and the "@" prevents that 
command itself from being displayed.

The next couple of lines incorporate your command to start a cmd.exe window 
with ADMIN credentials and also points it back to the starting batch-file 
again to run the other commands from the line labelled "BATCH".  You can 
use the "goto LABEL" command to jump to another part of the batch-file 
beginning with a colon followed by a chosen word i.e.;  :LABEL
The "goto :EOF" line is different, as you don't normally use the colon *in* 
the goto command and the line-label :EOF does not exist.  This special form 
of the "goto" command means : "goto [E]nd [O]f [F]ile"

The SET command can be used to set an environment variable that can be 
recalled in various ways and in this case is used by the DIR command to set 
chosen "switches" that will be applied automatically when set in the DIRCMD 
variable.  You can display a list of environment variables currently set, 
by typing the SET command with no parameters.

The COLOR command changes the default text color to cyan-on-black (my 
personal favourite).  Some doskey macros (see next item) can be set to 
simply change the text color by typing such as "red", "blue" and "green".

The DOSKEY command is for a command-line editor program that allows you to 
use the up / down left /right arrow keys to modify past typed commands. 
This allows you to change a small part of a large command or repeat a 
command often used to save time in both cases.  It also points doskey to 
the file: ADMIN.MAC is a file which contains doskey command-line macros, a 
sample of which is reproduced below :

ADMIN.MAC
------------------- copy between lines -(start)------------------

maced=edit C:\WINDOWS\ADMIN.MAC
macm=DOSKEY /MACROS
macf=DOSKEY.EXE /MACROFILE=C:WINDOWS\ADMIN.MAC
c=cls
q=exit
red=color 0C
blue=color 09
green=color 0A
cyan=color 0B
cmdhelp=hh.exe ntcmds.chm::/ntcmds.htm

------------------- copy between lines -(end)-------------------

For a list of commands for use with the "command-line" (that is; in a 
"dos-box") type the following into the "Run" box on the Start Menu :

hh.exe ntcmds.chm::/ntcmds.htm

==

Cheers,    Tim Meddick,    Peckham, London.    :-)




"Mint" <chocolatemint77581@yahoo.com> wrote in message 
news:78ea8389-c926-4b19-be77-cddfb10302af@z33g2000vbb.googlegroups.com...
>I tried adding some more functionality to the batch file below with no
> success.
> Is there a way that I can add to this batch file?
>
> For example, color 1f and loading some macros would be great too.
>
> Thanks.
>
> runas.exe /user:Administrator cmd.exe 

0
Tim
6/2/2010 9:26:01 PM
Reply:

Similar Artilces:

Add non-inventory item in MO Reciept entry (Unit Cost)
Dear All, I am using the (Add Component) button on the MO Reciept entry screen to add some non-inventory items, I notice that the decimal places for the unit cost is (2) although my Functional currency is (3). Kindly advice for the reason behind this, or if there is any setup required for that. Thanks Dear, Go to Tools --> Setup --> Purchasing --> Purchase Order Processing Find Decimal Places for Non-inventoried Items, click on the Expantion Button near to the Currency Field and set the decimal places for you curreny. Regards, -- Mohammad R. Daoud MCP, MCBMSP, MCTS, MCBMSS S...

MSCRM Call Scheduling Add-on
Does anyone know of any add-on to CRM 4.0 that will help my call center staff better schedule their calls? If they each manage, say, 500 accounts, then what I want is a regular 45-day call schedule and a nice easy-to-digest view in CRM that shows them which calls they need to make for the day etc. ...

can't get "sum" to add up properly
Hi, I'd appreciate any help with my problem. I have the following A B C 1 Benefit Coverage Amount Monthly Premium 2 Employee Life .21/$1,000 $67,000.00 $14.07 3 Dependent Life (if applicable) family $2.00 4 Employee AD&D .04/$1,000$67,000.00 $2.68 5 LTD 2.58/100 $1,529.00 $39.45 6 Dental family 47.86 7 Health family 48.90 8 EAP (if applicable) yes $2.20 9 ...

Help for a newbie trying to add hours and minutes :)
Hello all, the wonders of the internet may just solve this problem which has my office stumped... from a entry gate system i have a huge excel spreadsheet with totals per day of hours on site per employee... essentially as below on a much larger scale. dave I 01/01 I 7:15 dave I 02/07 I 8:20 dave I 03/07 I 8:20 dave I 04/01 I 8:30 dave I 05/01 I 8:20 the capital i's are inserted just to show where the next cell, so for the mini data above - employee dave (cell one) was on site for 7 hours and 15 minutes (cell two) on 01/01 (cell three), then for 8 hours and 20 minutes on 02/01. "...

remove com add-ins in Office 2007
I have Chinese menues appearing when I enter Access, which I have traced to a Com Add-In. I have found a way to disable it, but want to remove it permanently. When I try to remove it a message says only an administrator can remove the Add-In. I am the administrator for Windows operating system on my computer, but cannot remove a Com Add-In within Access. What am I missing or doing wrong? What operating system? If Vista or Win 7, find msaccess.exe wherever it is in Program Files, right-click on it and select Run as Administrator. -- Doug Steele, Microsoft Access MVP http:...

How to Add Columns to "Blank" MS Project?
Is there a way to add columns to "Blank" project that comes up when I click on File/New? I want to always have Text1, Text2, etc with the names Renamed on every Project file I open. This is a multi-part message in MIME format. ------=_NextPart_000_0014_01CAC558.64747C70 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi TKGerdie, Welcome to this Microsoft Project newsgroup :-) The best way is to set up a project as you want it and then save it as a = template. Please see FAQ Item: 8. New Project Template. ...

Add and replace in notepad
Im trying to re-format a very large data set so that i can make use of it. THe data is set out something like this: -1222 -1293 -1283 -8937 -2839 -2840 -3243 and i need it to be like this. -1222 -1293 -1283 -8937 -2839 -2840 -3243 Yes, i could do this manually but with about 65,000 entries this will take to long. I was hopeing to use the find & replace function to find all the gaps and replace them with [ENTER], but this i can not do. Does anybody know how to do this or of any other way of re-formatting data like this. Cheers, Andy, I...

Outlook Com Add-in
The Com-add will not stay checked and load the CRM toolbar. Any ideas? Also I am only showing three folders, search, delete and customer forms under Microsoft CRM. I have installed several times but keep getting the same result. We have other workstations where it installed fine. Any help would be greatly appreciated. Clyde HAve you just tried removing the COM addin then restarting outlook and adding it back in then restarting outlook? Did you get any errors during the install? In some cases that i have had this happen either you can pay for support from Microsoft. But what has ...

add individual data points to a bar chart of averages
I have groups of data points in categories. I can easily calculate the average in each category and show these as a bar chart, but is it possible to show the individual data pioints in each category as well? Thanks, Hi, How are you plotting the data points - as columns or line? and also could you show us dummy data layed out so we can understand what you data looks like. If you plot a clustered column chart you could show the average for each cluster as a line within the cluster or as a single point. -- Thanks, Shane Devenshire "lenos" wrote: > I have groups of dat...

How to add an icon to Excel toobar to choose colour of a border
Hi, Back again. Having now created a pre-formatted workbook and worksheet in the way that I was helped here, in this ng, earlier, I am now setting up my customized toolbar, with the icons that most suit me. I have placed on my custom toolbar an icon that lets me choose, quickly, what kind of border I want to add to a cell, however I don't know how to place in the same toolbar an icon that will allow me to choose the *colour* of that border. I have read in the Excel "Help" notes where it says that the correct icon is the one by which one chooses the colour of a drawn line. Tha...

How to add the date after the "A1"
Hi, I type "The information gathered as of March 9, 2008" on cell "A1" Is there a way to make a date default like "The information gathered as of " & Date (default). Your help would be much apprecated. ="The informations gathered as of "&TEXT(TODAY(),"mmmm d, yyyy") -- Kind regards, Niek Otten Microsoft MVP - Excel <learning_codes@hotmail.com> wrote in message news:c11a1bfc-65ba-4cf3-bdef-c28bdcc19c1d@8g2000hse.googlegroups.com... | Hi, | | I type "The information gathered as of March 9, 2008" on cell "A1&q...

Selective enabling of add ons
It would be nice if IE would allow me to enable add-ons for certain web pages. For example, I need flash installed to access my Bank. But I get annoyed by all the flash-based ads on other websites. I would like to enable flash for my Bank & youtube only. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and th...

Receive an error message when try to add a chart to a workbook
Hi!; When I'm using Excel has faced a problem. When I add multiple charts in a workbook, eventually the excel system prompts me an error "No more new fonts may be applied in this workbook". I have checked the problem in Microsoft Knowledge base and based on the knowledge this problem occurs because of the Auto scale setting. So I followed the instruction to edit the registry value and also disable auto scale in each charts. However when I retry to add some more charts in same workbook but the same error still came out, so the problem still can not solve. Therefore anyone ...

Add-in damaged Excel
Hi! I just saved a signature creating macro on our server as an add-in. This way I can install the add-in on all our workstations and by that give everyone easy access to the macro. All worked well at first. However, after a small modification of the code, and a new save-as add-in, my Excel just wouldn't start. "There was an error starting this add-in..." and so on. I'm asked to send a report to Microsoft and then Excel shuts down. I have unistalled Office and reistalled it again, but still the same problem. Does anyone have an idea hat I should do next? A register proble...

Add a column to Items table
Hi, I am using ver 1.2 and we have added bin locations (under the Special tab) to our inventory to help us locate items. Can I get the bin location to show up in a column on the Items table (Database > Items)? Thanks, George George, Not out of the box. You would need a customization to accomplish this. If you are interested in one let us know. Give us a call at 1-888-267-RITE or drop us an email at sales@rite.us. -- Thank you, Ryan Sakry Program Manager Retail Information Technology Enterprises (RITE) rsakry@rite.us http://www.rite.us 320-230-2282 ext. 4002 (Office) 320-230-179...

Using SumProduct to add values
I have the following data Column A: Date Column B: Module Name Column C: Numeric Value The question I have is: Lets say that I want to use a formula in cel D3 that adds all the values in column C that have date equal to may and in column B module name equal to "Test". I've using SumProduct t get the total number of rows that meet my criteria, but is there a wa I can add the actual values together? Thanks for your help! R -- Message posted from http://www.ExcelForum.com Hi try =SUMPRODUCT(--(A1:A100=DATE(2004,5,3)),--(B1:B100="Test"),C1:C100) -- Regards Fran...

faq can not add Template declarations
Hi, Is vc++ 6.0 can not add Template declarations or definitions ? Can vs2003 do add ? Microsoft Visual C++ --------------------------- Template declarations or definitions cannot be added. --------------------------- ok --------------------------- That's odd. I've been adding template declarations and definitions in VS6 for as many years as it has been available. Text editors are wonderful tools for doing this. What's the problem? joe On Wed, 6 Sep 2006 15:33:57 +0800, "fcvcnet" <fcvcnet@163.com> wrote: >Hi, > Is vc++ 6.0 can not add Te...

Where are the add-ins in Office 2008?
I just installed Mac Office 2008 and I am unable to find any add-ins in Excel (Tools > Add-ins). I rely on the statistical add-in quite a bit for school work. I wasn't prompted for anything during the installation. Thanks. "Alexander Malov" <alxmlv@gmail.com> wrote in message news:bbe16334-e3df-44d3-9925-52af7969d221@k39g2000hsf.googlegroups.com... >I just installed Mac Office 2008 and I am unable to find any add-ins > in Excel (Tools > Add-ins). I rely on the statistical add-in quite a > bit for school work. I wasn't prompted for anything during the &...

Macro command to turn on File Menu
Hi all, I have hidden the MENU BAR using a macro command on purpose. For the user to 'save/save as' his work, I plan to have a button on that worksheet. The user can open the FILE menu, using that button when pressed. Can someone suggest a macro command for that button to work the way I plan it to be if it is possible. Thank you so much. Zainuddin Z One way is to just show the File|Save as dialog. Option Explicit Sub testme() Application.Dialogs(xlDialogSaveAs).Show End Sub Zainuddin Zakaria wrote: > > Hi all, > > I have hidden the MENU BAR using a mac...

how to add a resource from a different project in to existing one
I created one project with so many dialogs. But now I hav eto go for another project as there is change in userinterface but much of the dialogs will be useful to me. Is there any short cut so that I can use that project resource in to my project. I am in VS 8.0 Pls guide. Thanks If the dialogs can be reused in both projects, you could wrap these in a dll (resource only or a regular MFC dll). Another option would be to cut paste the resources in resource editor. --- Ajay Bhargs wrote: > I created one project with so many dialogs. > But now I hav eto go for another project as there is...

add additional column in pivot table
I have create a pivot table and used grouping function to grouping data into two months, one column is June and the other is July, how can I able to have one more column to calculate the two month difference in % ?? ...

Excel 2000 & XP with Vision Add In
Hi, I have set up various spreadsheets which pull in data directly from a database, SUN Accounts) via an add in called Vision(manufactured by Lasata). This generally worked fine until I upgraded my pc to Windows XP and Office XP. Since then for some reason certain excel files won't open for me in XP. It just keeps crashing and using the recover function which shows the file to be totally trashed and most of the formulae are corrupted. However the gas thing is if I switch to my old pc running Windows NT and Office 2000 I can open the file no problem. Any ideas on this would be appreciate...

need to add large amount of selected users to a distribution group
Is there an easy way to create a distribution group by importing a list of users into it using a .csv? This is on Exchange 5.5. I'm not ready to sit here, choose and select 900 users! "dude" <dude@aol.com> wrote: >Is there an easy way to create a distribution group by importing a list of >users into it using a .csv? This is on Exchange 5.5. I'm not ready to sit >here, choose and select 900 users! You can use the directory import tool. The details are in the maintenance and troubleshooting guide you'll find in the the online docs. You'll still h...

Add configuration to default "Customer Lookup" to Contact
Add configuration options to MSCRM 3.0 so that various parameters of lookups can be configured. For example, making the "Customer Lookup" (popup window or Form Assistant) default to looking up a Contact, if that is what the client prefers. Other examples include setting default Entity when clicking on "Track in CRM" from Outlook. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, fol...

how do I add a picture to my e-mail signature?
I'd like to add a picture to my signature- but don't have the first clue on how to go about doing this - can someone help me? Make sure your email format is HTML. Open the picture in Explorer, copy it, and then paste it into your signature. It should be that simple. I do it with animated .gifs and .jpgs for holidays all the time. -- Kathleen Orland Outlook Tips: http://www.outlook-tips.net/ http://www.howto-outlook.com/ Outlook & Exchange Solutions Center: http://www.slipstick.com "furby" wrote: > I'd like to add a picture to my signature- but don'...