Search found 19 matches
- 24 Nov 2019 01:34
- Forum: DOS Batch Forum
- Topic: single line in runonce
- Replies: 4
- Views: 4892
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...
- 20 Apr 2018 02:49
- Forum: DOS Batch Forum
- Topic: running multiple ssh commands in a batch file
- Replies: 7
- Views: 18690
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 ^
)
- 20 Apr 2018 01:48
- Forum: DOS Batch Forum
- Topic: running multiple ssh commands in a batch file
- Replies: 7
- Views: 18690
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.
Can you explain how it would work?
Code: Select all
: << '____CMD____'
@echo off
ssh "%~f0" %*
goto :eof
____CMD____
pwd
ls
- 19 Apr 2018 21:59
- Forum: DOS Batch Forum
- Topic: running multiple ssh commands in a batch file
- Replies: 7
- Views: 18690
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.
- 19 Apr 2018 21:05
- Forum: DOS Batch Forum
- Topic: running multiple ssh commands in a batch file
- Replies: 7
- Views: 18690
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'...
- 30 May 2016 23:51
- Forum: DOS Batch Forum
- Topic: check if a removable drive exists before running
- Replies: 3
- Views: 4816
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 ...
- 01 Dec 2015 15:57
- Forum: DOS Batch Forum
- Topic: batch file never ends
- Replies: 3
- Views: 4074
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...
- 01 Dec 2015 15:17
- Forum: DOS Batch Forum
- Topic: batch file never ends
- Replies: 3
- Views: 4074
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 &...
- 05 Sep 2015 23:02
- Forum: DOS Batch Forum
- Topic: batch file sending command to linux computer not working
- Replies: 7
- Views: 5447
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?
In case there's something wrong with the host names or password, do you have a suggestion?
- 05 Sep 2015 11:01
- Forum: DOS Batch Forum
- Topic: batch file sending command to linux computer not working
- Replies: 7
- Views: 5447
Re: batch file sending command to linux computer not working
can you assist with the problem at hand?
- 05 Sep 2015 09:56
- Forum: DOS Batch Forum
- Topic: batch file sending command to linux computer not working
- Replies: 7
- Views: 5447
Re: batch file sending command to linux computer not working
whats your point?
- 05 Sep 2015 09:39
- Forum: DOS Batch Forum
- Topic: batch file sending command to linux computer not working
- Replies: 7
- Views: 5447
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 ...
- 28 Nov 2013 07:50
- Forum: DOS Batch Forum
- Topic: Backing up specific file formats
- Replies: 2
- Views: 2761
Re: Backing up specific file formats
Thanks.
I removed the /E and now it copies only the *.id files.
I removed the /E and now it copies only the *.id files.
- 28 Nov 2013 06:46
- Forum: DOS Batch Forum
- Topic: Backing up specific file formats
- Replies: 2
- Views: 2761
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...
- 14 Nov 2013 00:35
- Forum: DOS Batch Forum
- Topic: Run exe if "model number"
- Replies: 12
- Views: 8502
Re: Run exe if "model number"
Yes, now the %model% variable is working
But now when I run
I get
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.