Search found 19 matches

by aristosv
24 Nov 2019 01:34
Forum: DOS Batch Forum
Topic: single line in runonce
Replies: 4
Views: 4403

single line in runonce

I want to put a RunOnce entry in my autounattend.xml, that will detect the USB drive, and run a batch file located on the USB drive. My problem is that a RunOnce entry is a single line, I can't have 2 lines. in my testing this works, but it's 2 lines for %%i in (A:,B:,D:,E:,F:,G:,H:,I:,J:,K:,L:,M:,N...
by aristosv
20 Apr 2018 02:49
Forum: DOS Batch Forum
Topic: running multiple ssh commands in a batch file
Replies: 7
Views: 17275

Re: running multiple ssh commands in a batch file

I had to find the line continuation character (^) and put it at the end of each line. That's it.

Code: Select all

plink.exe -ssh user@<ip> -P 22 -pw pass ( ^
ls; ^
pwd ^
)
by aristosv
20 Apr 2018 01:48
Forum: DOS Batch Forum
Topic: running multiple ssh commands in a batch file
Replies: 7
Views: 17275

Re: running multiple ssh commands in a batch file

I'm no batch file expert so I find it difficult to understand how this code works.

Code: Select all

: << '____CMD____'
@echo off
ssh "%~f0" %*
goto :eof
____CMD____

pwd
ls
Can you explain how it would work?
by aristosv
19 Apr 2018 21:59
Forum: DOS Batch Forum
Topic: running multiple ssh commands in a batch file
Replies: 7
Views: 17275

Re: running multiple ssh commands in a batch file

Yes. I don't want to use a separate file for the commands. I want to have them in the batch file.
by aristosv
19 Apr 2018 21:05
Forum: DOS Batch Forum
Topic: running multiple ssh commands in a batch file
Replies: 7
Views: 17275

running multiple ssh commands in a batch file

Hi, This works as a batch file. plink.exe -ssh user@<ip address> -P 22 -pw password ( pwd ; ls ;) It executes the 2 commands and shows me the results. But what if I have to run 100 commands. I'll have to arrange them vertically. So I tried various things but I can't figure it out. The following don'...
by aristosv
30 May 2016 23:51
Forum: DOS Batch Forum
Topic: check if a removable drive exists before running
Replies: 3
Views: 4285

check if a removable drive exists before running

Hi, I am using this, to eject a removable drive. echo Removing Drive for /F "tokens=1*" %%a in ('fsutil fsinfo drives') do ( for %%c in (%%b) do ( for /F "tokens=3" %%d in ('fsutil fsinfo drivetype %%c') do ( if %%d equ Removable ( %~dp0RemoveDrive.exe %%c -L -b ) ) ) ) But if a ...
by aristosv
01 Dec 2015 15:57
Forum: DOS Batch Forum
Topic: batch file never ends
Replies: 3
Views: 3729

Re: batch file never ends

That script runs a few commands and starts 2 more scripts that use nohup and &. But still, it doesnt exit, so the batch file can continue to the next server. If I run the "start" script on the Linux server itself, after it runs the commands it finishes. But using plink it doesnt, for s...
by aristosv
01 Dec 2015 15:17
Forum: DOS Batch Forum
Topic: batch file never ends
Replies: 3
Views: 3729

batch file never ends

This is probably an issue with Linux, but it might be solvable in a batch file. So here it goes. Running the batch file below, will run "ls" on as many Linux servers exist in "ip.txt" for /f "tokens=*" %%a in (%~dp0ip.txt) do ( %~dp0plink -batch -ssh -pw pass root@%%a &...
by aristosv
05 Sep 2015 23:02
Forum: DOS Batch Forum
Topic: batch file sending command to linux computer not working
Replies: 7
Views: 4866

Re: batch file sending command to linux computer not working

Are you saying that I should provide the actual host names and the actual password?
In case there's something wrong with the host names or password, do you have a suggestion?
by aristosv
05 Sep 2015 11:01
Forum: DOS Batch Forum
Topic: batch file sending command to linux computer not working
Replies: 7
Views: 4866

Re: batch file sending command to linux computer not working

can you assist with the problem at hand?
by aristosv
05 Sep 2015 09:39
Forum: DOS Batch Forum
Topic: batch file sending command to linux computer not working
Replies: 7
Views: 4866

batch file sending command to linux computer not working

I am running the following batch file, to make a modification in a file on a linux computer. plink.exe -ssh root@192.168.0.30 -pw password_here /bin/sed -i -e '/export s_sshhost="hostname1_here"/a export s_vpnhost="hostname2_here"' /file/to/edit/here I get this message & was ...
by aristosv
28 Nov 2013 07:50
Forum: DOS Batch Forum
Topic: Backing up specific file formats
Replies: 2
Views: 2494

Re: Backing up specific file formats

Thanks.

I removed the /E and now it copies only the *.id files.
by aristosv
28 Nov 2013 06:46
Forum: DOS Batch Forum
Topic: Backing up specific file formats
Replies: 2
Views: 2494

Backing up specific file formats

I am trying to backup a bunch of *.id files, so I am using the batch file below. SET xcopy=XCOPY /D /E /C /I /H /R /K /Y SET idfiles="C:\Documents and Settings\%username%\IDFiles\*.id" SET datadest="C:\Backup" %xcopy% %idfiles% %datadest%\IDFiles My problem is that any other file...
by aristosv
14 Nov 2013 00:35
Forum: DOS Batch Forum
Topic: Run exe if "model number"
Replies: 12
Views: 7316

Re: Run exe if "model number"

Yes, now the %model% variable is working :)

But now when I run

Code: Select all

IF %model%==Latitude E6500 (echo ---Run Executable) ELSE (echo ---Don't Run Executable)

I get

Code: Select all

E6500 was unexpected at this time.