Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
SIMMS7400
- Posts: 546
- Joined: 07 Jan 2016 07:47
#1
Post
by SIMMS7400 » 15 Jan 2016 17:24
Good Evening -
I have a need to copy files across servers, however at this particular client, we use tokens to log onto servers, which expire every 30 seconds.
Is there a way to copy files using a batch file when using tokens?
This is the script I use all other times when copying to another windows server:
Code: Select all
REM ------------------------------------------------------------------------
REM COPY LATEST VERSION TO TEST
REM ------------------------------------------------------------------------
net use Y: /delete
net use Y: \\hyper-util-tst\C$\DRM_PROJECT\BACKUPS\SCHEDULED_BACKUPS\RFF_BACKUPS %SERVICEACCOUNT%
xCOPY %DRMPROJECT%%BACKUPS%%SCHEDULEDBACKUPS%%RFF%%BTFVERSION% Y:\ /y
net use Y: /delete /y
Thank you!
-
Squashman
- Expert
- Posts: 4486
- Joined: 23 Dec 2011 13:59
#2
Post
by Squashman » 15 Jan 2016 20:51
Are you referring to RSA tokens? Yes they expire so many seconds but once you establish a connection it should keep the connection alive.
You may want to provide more detail to your question so we have a better grasp of how your network is configured.
-
SIMMS7400
- Posts: 546
- Joined: 07 Jan 2016 07:47
#3
Post
by SIMMS7400 » 15 Jan 2016 22:10
Squashman -
That is correct. I was wondering how to establish that connection using a batch file. Normally, I would just pass the username and password via batch file as shown above. However, since my RSA password (token) changes every 30 seconds, how does one incorporate that into a batch file? Is there a 'static' password I can pass?
Thank you.
-
ShadowThief
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
#4
Post
by ShadowThief » 15 Jan 2016 23:48
Pretty sure that would defeat the purpose of RSA tokens
-
foxidrive
- Expert
- Posts: 6031
- Joined: 10 Feb 2012 02:20
#5
Post
by foxidrive » 16 Jan 2016 03:12
I'm not sure what problem you see in your usage with the script.
%SERVICEACCOUNT% is the password variable - how it is being populated?
You can use a script that prompts you for your password - but how do you determine what your password is?
You'll have to excuse my lack of RSA token knowledge.
-
foxidrive
- Expert
- Posts: 6031
- Joined: 10 Feb 2012 02:20
#6
Post
by foxidrive » 16 Jan 2016 03:13
Squashman wrote:Are you referring to RSA tokens? Yes they expire so many seconds but once you establish a connection it should keep the connection alive.
Does that mean it will work for the file copy, but expire if the connection is then idle for an extra 30 seconds?
-
SIMMS7400
- Posts: 546
- Joined: 07 Jan 2016 07:47
#7
Post
by SIMMS7400 » 16 Jan 2016 08:35
ShadowThief wrote:Pretty sure that would defeat the purpose of RSA tokens
Precisely - so is there a way around this?
-
foxidrive
- Expert
- Posts: 6031
- Joined: 10 Feb 2012 02:20
#8
Post
by foxidrive » 16 Jan 2016 09:52
ctakacs didn't follow up in his previous thread here to say thanks or tell us he had a solution.
It's up to you guys but it may not be worth continuing this thread.
-
SIMMS7400
- Posts: 546
- Joined: 07 Jan 2016 07:47
#9
Post
by SIMMS7400 » 16 Jan 2016 13:01
foxidrive wrote:ctakacs didn't follow up in his previous thread here to say thanks or tell us he had a solution.
It's up to you guys but it may not be worth continuing this thread.
I don't have a solution yet.
-
SIMMS7400
- Posts: 546
- Joined: 07 Jan 2016 07:47
#10
Post
by SIMMS7400 » 16 Jan 2016 13:02
foxidrive wrote:I'm not sure what problem you see in your usage with the script.
%SERVICEACCOUNT% is the password variable - how it is being populated?
You can use a script that prompts you for your password - but how do you determine what your password is?
You'll have to excuse my lack of RSA token knowledge.
Well the above works and that's what im using at other clients where I dont use RSA tokens. However, since the password (tokens) expires every 30 seconds, how do I pass that through a batch file?
-
ShadowThief
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
#11
Post
by ShadowThief » 16 Jan 2016 18:54
ctakacs wrote:ShadowThief wrote:Pretty sure that would defeat the purpose of RSA tokens
Precisely - so is there a way around this?
You're trying to bypass two-factor authentication. It's literally not possible to do what you're asking.
-
SIMMS7400
- Posts: 546
- Joined: 07 Jan 2016 07:47
#12
Post
by SIMMS7400 » 19 Jan 2016 07:28
Thank you for the replies folks.
I'll explore other options!