Go Back   DaemonForums > Other Operating Systems > Other OS

Other OS Any other OS such as Microsoft Windows, BeOS, Plan9, Syllable, and whatnot.

Thread Tools Display Modes
  #1   (View Single Post)  
Old 12th June 2009
a6zj6 a6zj6 is offline
New User
Join Date: Jun 2009
Posts: 1
Default Dos batch file administrator privileges required

This is my first post, so here goes...

I have written a dos batch file that makes use of the "pushd" command. On my network, in order to use this command elevated privileges are required. Is it possible to do the following in one batch file, and if so, how (because I can't seem to figure it out!)?

Prompt user running batch file for administrator password
Re-run same batch file only with elevated privileges
Skip administrator prompt and execute other commands in the file

Also, is it possible to pass variables to a new command prompt window that is spawned?

I was hoping to do the above with one batch file.
Reply With Quote
  #2   (View Single Post)  
Old 12th June 2009
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243


The runas command is the first thing I would think of.

See http://technet.microsoft.com/en-us/l.../bb490994.aspx

There is also some help available from:
> runas /?
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote

admin, batch, dos, pushd

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP read file contents - Maximum file size cksraj Programming 1 21st September 2009 11:38 AM
Required packages for running X enpey FreeBSD Ports and Packages 7 20th August 2008 09:16 AM
file:/// mfaridi FreeBSD Security 3 27th July 2008 02:18 PM
VSFTPd: pid file kostromin FreeBSD Ports and Packages 0 4th July 2008 08:35 AM
How to get NAT log file on FreeBSD ? chamnanpol FreeBSD General 1 17th June 2008 11:49 PM

All times are GMT. The time now is 06:57 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick