A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » Customizing Windows XP
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

runas script to launch batch file



 
 
Thread Tools Display Modes
  #1  
Old December 8th 09, 03:09 AM posted to microsoft.public.scripting.vbscript,microsoft.public.windows.server.scripting,microsoft.public.windowsxp.customize
Donald MacKenzie
external usenet poster
 
Posts: 10
Default runas script to launch batch file

Hello again. I have another program that need to be lauched by a batchfile
however it needs to be run as a different user

here we go.

batchfile name is: mount-truecrypt.bat
inside has this:

REM mounting truecypt volumes !! do not change !!
"c:\program files\truecrypt\truecrypt.exe" /volume
"\Device\Harddisk1\Partition1" /letter F /favorites /p newutopianewutopia10
/q
"c:\program files\truecrypt\truecrypt.exe" /volume
"\Device\Harddisk2\Partition1" /letter N /favorites /p newutopianewutopia10
/q


REM starting sharing for truecrypt /y is required for unattended interaction
net stop server /y
net start server /y
net start "computer browser" /y
exit

i need this file to run as the user truecrypt with the password 1234567890



Ads
  #2  
Old December 8th 09, 05:22 PM posted to microsoft.public.scripting.vbscript,microsoft.public.windows.server.scripting,microsoft.public.windowsxp.customize
Tim Meddick
external usenet poster
 
Posts: 1,995
Default runas script to launch batch file

To run your batchfile as a different user on the local or remote machine :

runas /user:truecrypt "mount-truecrypt.bat"

Here, the user "truecrypt" can be replaced with "remotepc\truecrypt" where 'remotepc'
is the computername of a remote machine.

The above command requires you to input the specified user's password when requested.

However, if you need the command to run "unattended" (as in a batch file) you will
need to download [psexec.exe] from sysinternals)

psexec remotepc -u truecrypt -p 1234567890 c:\windows\mount-truecrypt.bat

Please note that, in this command, an "absolute path" to the target-program is
required.

==

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




"Donald MacKenzie" wrote in message
...
Hello again. I have another program that need to be lauched by a batchfile however
it needs to be run as a different user

here we go.

batchfile name is: mount-truecrypt.bat
inside has this:

REM mounting truecypt volumes !! do not change !!
"c:\program files\truecrypt\truecrypt.exe" /volume "\Device\Harddisk1\Partition1"
/letter F /favorites /p newutopianewutopia10 /q
"c:\program files\truecrypt\truecrypt.exe" /volume "\Device\Harddisk2\Partition1"
/letter N /favorites /p newutopianewutopia10 /q


REM starting sharing for truecrypt /y is required for unattended interaction
net stop server /y
net start server /y
net start "computer browser" /y
exit

i need this file to run as the user truecrypt with the password 1234567890




  #3  
Old December 8th 09, 05:22 PM posted to microsoft.public.scripting.vbscript,microsoft.public.windows.server.scripting,microsoft.public.windowsxp.customize
Tim Meddick
external usenet poster
 
Posts: 1,995
Default runas script to launch batch file

To run your batchfile as a different user on the local or remote machine :

runas /user:truecrypt "mount-truecrypt.bat"

Here, the user "truecrypt" can be replaced with "remotepc\truecrypt" where 'remotepc'
is the computername of a remote machine.

The above command requires you to input the specified user's password when requested.

However, if you need the command to run "unattended" (as in a batch file) you will
need to download [psexec.exe] from sysinternals)

psexec remotepc -u truecrypt -p 1234567890 c:\windows\mount-truecrypt.bat

Please note that, in this command, an "absolute path" to the target-program is
required.

==

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




"Donald MacKenzie" wrote in message
...
Hello again. I have another program that need to be lauched by a batchfile however
it needs to be run as a different user

here we go.

batchfile name is: mount-truecrypt.bat
inside has this:

REM mounting truecypt volumes !! do not change !!
"c:\program files\truecrypt\truecrypt.exe" /volume "\Device\Harddisk1\Partition1"
/letter F /favorites /p newutopianewutopia10 /q
"c:\program files\truecrypt\truecrypt.exe" /volume "\Device\Harddisk2\Partition1"
/letter N /favorites /p newutopianewutopia10 /q


REM starting sharing for truecrypt /y is required for unattended interaction
net stop server /y
net start server /y
net start "computer browser" /y
exit

i need this file to run as the user truecrypt with the password 1234567890




  #4  
Old December 9th 09, 04:50 AM posted to microsoft.public.scripting.vbscript,microsoft.public.windows.server.scripting,microsoft.public.windowsxp.customize
Al Dunbar[_2_]
external usenet poster
 
Posts: 4
Default runas script to launch batch file



"Tim Meddick" wrote in message
...
To run your batchfile as a different user on the local or remote machine :

runas /user:truecrypt "mount-truecrypt.bat"

Here, the user "truecrypt" can be replaced with "remotepc\truecrypt" where
'remotepc' is the computername of a remote machine.


Just to avoid some possible confusion, using "/user:remotepc\username"
switch does not cause the batch file to be run on the remote PC. It will run
on the pc on which you are typing the runas command, but using the
credentials of an account on another machine.

To actually run a batch file on a remote system requires a facility such as
psexec (as explained below).

The above command requires you to input the specified user's password when
requested.

However, if you need the command to run "unattended" (as in a batch file)
you will need to download [psexec.exe] from sysinternals)

psexec remotepc -u truecrypt -p 1234567890 c:\windows\mount-truecrypt.bat

Please note that, in this command, an "absolute path" to the
target-program is required.


Note also that the path is relative to the remote pc, not the local one.

/Al


==

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




"Donald MacKenzie" wrote in message
...
Hello again. I have another program that need to be lauched by a
batchfile however it needs to be run as a different user

here we go.

batchfile name is: mount-truecrypt.bat
inside has this:

REM mounting truecypt volumes !! do not change !!
"c:\program files\truecrypt\truecrypt.exe" /volume
"\Device\Harddisk1\Partition1" /letter F /favorites /p
newutopianewutopia10 /q
"c:\program files\truecrypt\truecrypt.exe" /volume
"\Device\Harddisk2\Partition1" /letter N /favorites /p
newutopianewutopia10 /q


REM starting sharing for truecrypt /y is required for unattended
interaction
net stop server /y
net start server /y
net start "computer browser" /y
exit

i need this file to run as the user truecrypt with the password
1234567890




  #5  
Old December 9th 09, 04:50 AM posted to microsoft.public.scripting.vbscript,microsoft.public.windows.server.scripting,microsoft.public.windowsxp.customize
Al Dunbar[_2_]
external usenet poster
 
Posts: 4
Default runas script to launch batch file



"Tim Meddick" wrote in message
...
To run your batchfile as a different user on the local or remote machine :

runas /user:truecrypt "mount-truecrypt.bat"

Here, the user "truecrypt" can be replaced with "remotepc\truecrypt" where
'remotepc' is the computername of a remote machine.


Just to avoid some possible confusion, using "/user:remotepc\username"
switch does not cause the batch file to be run on the remote PC. It will run
on the pc on which you are typing the runas command, but using the
credentials of an account on another machine.

To actually run a batch file on a remote system requires a facility such as
psexec (as explained below).

The above command requires you to input the specified user's password when
requested.

However, if you need the command to run "unattended" (as in a batch file)
you will need to download [psexec.exe] from sysinternals)

psexec remotepc -u truecrypt -p 1234567890 c:\windows\mount-truecrypt.bat

Please note that, in this command, an "absolute path" to the
target-program is required.


Note also that the path is relative to the remote pc, not the local one.

/Al


==

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




"Donald MacKenzie" wrote in message
...
Hello again. I have another program that need to be lauched by a
batchfile however it needs to be run as a different user

here we go.

batchfile name is: mount-truecrypt.bat
inside has this:

REM mounting truecypt volumes !! do not change !!
"c:\program files\truecrypt\truecrypt.exe" /volume
"\Device\Harddisk1\Partition1" /letter F /favorites /p
newutopianewutopia10 /q
"c:\program files\truecrypt\truecrypt.exe" /volume
"\Device\Harddisk2\Partition1" /letter N /favorites /p
newutopianewutopia10 /q


REM starting sharing for truecrypt /y is required for unattended
interaction
net stop server /y
net start server /y
net start "computer browser" /y
exit

i need this file to run as the user truecrypt with the password
1234567890




  #6  
Old December 15th 09, 02:13 PM posted to microsoft.public.scripting.vbscript,microsoft.public.windowsxp.customize,microsoft.public.windows.server.scripting
Anteaus
external usenet poster
 
Posts: 1,330
Default runas script to launch batch file

Better method which doesn't expose the password:

http://www.autoitscript.com/autoit3/...ions/RunAs.htm


"Donald MacKenzie" wrote:

Hello again. I have another program that need to be lauched by a batchfile
however it needs to be run as a different user

here we go.

batchfile name is: mount-truecrypt.bat
inside has this:

REM mounting truecypt volumes !! do not change !!
"c:\program files\truecrypt\truecrypt.exe" /volume
"\Device\Harddisk1\Partition1" /letter F /favorites /p newutopianewutopia10
/q
"c:\program files\truecrypt\truecrypt.exe" /volume
"\Device\Harddisk2\Partition1" /letter N /favorites /p newutopianewutopia10
/q


REM starting sharing for truecrypt /y is required for unattended interaction
net stop server /y
net start server /y
net start "computer browser" /y
exit

i need this file to run as the user truecrypt with the password 1234567890



.

  #7  
Old December 15th 09, 02:13 PM posted to microsoft.public.scripting.vbscript,microsoft.public.windowsxp.customize,microsoft.public.windows.server.scripting
Anteaus
external usenet poster
 
Posts: 1,330
Default runas script to launch batch file

Better method which doesn't expose the password:

http://www.autoitscript.com/autoit3/...ions/RunAs.htm


"Donald MacKenzie" wrote:

Hello again. I have another program that need to be lauched by a batchfile
however it needs to be run as a different user

here we go.

batchfile name is: mount-truecrypt.bat
inside has this:

REM mounting truecypt volumes !! do not change !!
"c:\program files\truecrypt\truecrypt.exe" /volume
"\Device\Harddisk1\Partition1" /letter F /favorites /p newutopianewutopia10
/q
"c:\program files\truecrypt\truecrypt.exe" /volume
"\Device\Harddisk2\Partition1" /letter N /favorites /p newutopianewutopia10
/q


REM starting sharing for truecrypt /y is required for unattended interaction
net stop server /y
net start server /y
net start "computer browser" /y
exit

i need this file to run as the user truecrypt with the password 1234567890



.

 




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

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






All times are GMT +1. The time now is 03:44 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.