Como você diz que está bem com as funções Windows , forneci algumas soluções de arquivos em lote abaixo com as operações administrativas e não administrativas que testei com Windows 7 . Como você diz que é solicitado a administrar, essa solução também solicitará a senha da / uma credencial de administrador para executá-la, como se tivesse uma opção para salvar para uso futuro depois de inseri-la apenas na primeira vez.
Arquivo em lote (prompt do administrador)
RUNAS /USER:<administrator> "CMD /C SUBST E: G:\SUBST\E"
RUNAS /USER:<administrator> "CMD /C NET USE Y: \SVR\PATH"
Note: When you use this method, you have to type in the password of the administrator account you run the commands as per each time these commands are run. You can use
CMD /Khere instead if you wish the elevated command prompt to stay up after running the commands.
Pararemovercredenciaissalvas
NacaixadediálogoExecutar(⊞+R)digiterundll32.exekeymgr.dll,KRShowKeyMgrepressioneEnter.QuandoasjanelasNomesdeusuárioesenhasarmazenadossãoabertas,vocêpoderealçarascredenciaisquedesejaexcluir,queestãosalvase,emseguida,pressioneaopçãoRemover.

Arquivoemlote(Admincom/SaveCred)
RUNAS/USER:<administrator>/SAVECRED"CMD /C SUBST E: G:\SUBST\E"
RUNAS /USER:<administrator> /SAVECRED "CMD /C NET USE Y: \SVR\PATH"
Note: When you use this method, you have to type in the password of the administrator account the first time you use it only and then on subsequent runs when you specify the
/SAVECREDswitch you do not need to enter the password any longer. You can useCMD /Khere instead if you wish the elevated command prompt to stay up after running the commands.
Arquivoemlote(nãoadministrador)
SUBSTE:G:\SUBST\ENETUSEY:\SVR\PATHNote:Whenyouusethismethod,youarenotpromptedandbasicallyyourunasthenon-elevateduseryouaresignedontothemachineassecuritycontextwise.
Maisrecursos
Runas - Cmd.exe

