V
vani
Is it possible to runas a whole batch file?
Like runas /user:admin install.cmd ?
Like runas /user:admin install.cmd ?
vanessa said:yep, but u have to enter the password manually
vani said:But in my case, when i run it like that and enter the password nothing
happens?
Pegasus said:It is not quite true that "nothing" happens - your screen flashes briefly
after you have entered the administrator's password. The cause of the
problem is simple: install.bat is unable to locate 1.cmd, because you did
not fully qualify its location. If you want your batch files to be robust
then you MUST fully qualify all paths. This applies to your copy command
too: Instead of writing
copy /y aCalendar.gms "C:\Program Files\Corel\CorelDRAW Graphics Suite
X4\Draw\GMS\"
you should write
copy /y aCalendar.gms "C:\Program Files\Corel\CorelDRAW Graphics Suite
X4\Draw\GMS\" "c:\MyDrawings"
so that the destination is properly specified.
Now try this version of install.cmd:
runas /user:administrator c:\MyTools\1.cmd
vani said:Yup that was it. Now if only i could make the batch files both execute in
the context of current directory of install.cmd.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.