IPB

Google Frontpage Forums Unattended CD/DVD Guide
 Forum Rules Windows Vista Forum Rules
 
Reply to this topicStart new topic
> How to run a bat file as admin?, Transparent to the user, without having to go thru any menu.
Th3_uN1Qu3
post Jul 3 2008, 06:43 AM
Post #1


Digital sinner
***

Group: Banned
Posts: 435
Joined: 17-March 08
From: Bucharest
Member No.: 182383
OS: Vista Ultimate x64
Country Flag


Just when i thought i fixed all bugs in the game i was patching, i realized it would throw voice errors under Vista or under updated XP. Turns out the game is hooked to a certain version of the ADPCM codec, and the one from 9x/Me/2k works, and the one from un-updated XP works. But when i update XP or try it under vista, boom. no.gif

The problem is that those two ADPCM codec files are located in system32, and Vista asks for admin privileges to replace them. I need to do this via the command line or via an AutoIt script, with none or minimal interaction from the user. The only prompting i can accept would be asking for an administrator password to replace the files.

Help please? Or i'm going back to XP, thank you. But it would be unfair to make the game only work on XP.
Go to the top of the page
 
+Quote Post
Smiley357
post Jul 3 2008, 07:39 AM
Post #2


Junior
*

Group: Members
Posts: 87
Joined: 12-October 07
Member No.: 158086
OS: XP Pro x86
Country Flag


you can use the Runas commonad from command line or you can right click on it and select runas.

if you type runas /? it will give you more information about the command.

CODE
runas /noprofile /user:mymachine\administrator cmd
this will open up a cmd window with the administrator privileges
Go to the top of the page
 
+Quote Post
spacesurfer
post Jul 3 2008, 08:22 AM
Post #3


Pharmassist
******

Group: Members
Posts: 1318
Joined: 31-July 04
From: United States
Member No.: 25917
OS: XP Pro x86
Country Flag


excellent tip. will see if it works. it's necessary for imagex scripts since they require admin privileges.
Go to the top of the page
 
+Quote Post
Th3_uN1Qu3
post Jul 3 2008, 06:22 PM
Post #4


Digital sinner
***

Group: Banned
Posts: 435
Joined: 17-March 08
From: Bucharest
Member No.: 182383
OS: Vista Ultimate x64
Country Flag


QUOTE (Smiley357 @ Jul 3 2008, 04:39 PM) *
you can use the Runas commonad from command line or you can right click on it and select runas.

if you type runas /? it will give you more information about the command.

CODE
runas /noprofile /user:mymachine\administrator cmd
this will open up a cmd window with the administrator privileges


It doesn't work. I get this:



Or am i supposed to also type in the username and computer name? If so i'll also need to find these via the command line. Besides, it says "Administrator: Command Prompt" in the title, then WHY THE HECK does it request admin permissions???

PS: The admin password is blank, i am the only user on the computer and have got admin privileges, and right-clicking and choosing "Run as administrator" works, but it STILL doesn't let me work with those files (imaadp32.acm and msadp32.acm). UAC is turned off btw.

Another edit: I found out i have to use takeown, well, i did a takeown /f on those files yet it STILL doesn't let me replace them. Takeown on the entire system32 folder doesn't work either. WTF is all this??? *fires up XP in Virtual PC, maximizes it and feels much better*

And yet another edit: I got the permissions set using the GUI, only that i've run into ANOTHER problem. The codecs that worked on XP don't work under Vista... I'm beginning to hate this.

This post has been edited by Th3_uN1Qu3: Jul 3 2008, 07:30 PM
Go to the top of the page
 
+Quote Post
DigeratiPrime
post Jul 5 2008, 09:52 AM
Post #5


MSFN Junkie
Group Icon

Group: Moderator
Posts: 3162
Joined: 18-August 04
From: Terra Incognita
Member No.: 28113
OS: Vista Ultimate x64
Country Flag


You need to have the Secondary Logon service running in order to use 'runas'.

What exactly are you trying to accomplish? You have a game that has sound in XP but not in Vista, so you want to copy the old decoder into Vista to see if it works?

BTW you can definitely script this, but I am not sure if it will be necessary. You need to use 'takeown' and 'icacls' for example:
QUOTE
takeown /f %SystemRoot%\System32\imaadp32.acm
icacls %SystemRoot%\System32\imaadp32.acm /G administrators:F
Go to the top of the page
 
+Quote Post

Google Frontpage Forums Unattended CD/DVD Guide

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 7th January 2009 - 08:40 PM
All trademarks mentioned on this page are the property of their respective owners
MSFN is not affiliated with Microsoft
Copyright © 2001-2008 msfn.org
Privacy Policy