Sponsored Content
Special Forums Windows & DOS: Issues & Discussions Command works on CMD line but not in batch? Post 302590419 by Grueben on Monday 16th of January 2012 06:51:13 AM
Old 01-16-2012
Command works on CMD line but not in batch?

Hi All,

This command works when I type it on but when I run the batch file it doesn't..any ideas why?

Code:
attrib.exe * | find /c /v "" >filecount.txt


Last edited by methyl; 01-26-2012 at 08:29 AM.. Reason: please use code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

works from cmd-line but not in script

hi I'm trying to query a directory, check it's the right directory, return the results into a text file, put text file into an array and navigate the subdirectories and delete contents. find `pwd` -type d | grep TESTINGDIR > dirList.txt The txt file is created from the cmd-line but not in... (4 Replies)
Discussion started by: OFFSIHR
4 Replies

2. Shell Programming and Scripting

find cmd works different on cron job ?

/usr/bin/find $SEARCH_DIR -daystart \( \( -name 'KI*' -a -name '*.csv' \) -o -name '*_xyz_*' \) -mtime $DAYS_AGO -printf %f -printf "\n" | sort -r > $FILES The above command gives different results when run on a cron job. When run manually the result is accurate. (2 Replies)
Discussion started by: nuthalapati
2 Replies

3. Shell Programming and Scripting

sed command works from cmd line to standard output but will not write to file

Hi all .... vexing problem here ... I am using sed to replace some special characters in a .txt file: sed -e 's/_<ED>_/_355_/g;s/_<F3>_/_363_/g;s/_<E1>_/_341_/g' filename.txt This command replaces <ED> with í , <F3> with ó and <E1> with á. When I run the command to standard output, it works... (1 Reply)
Discussion started by: crumplecrap
1 Replies

4. UNIX for Dummies Questions & Answers

Works on command line but not in script

Hey guys. Hopefully this is an easy one but having reference similar problems on the web I still can't fix it. I am doing a recursive find and replace from a script. Of course I could just run the damn thing from the command line but it's bugging me now and want to get it working. grep -rl... (4 Replies)
Discussion started by: anthonyjstewart
4 Replies

5. UNIX for Advanced & Expert Users

SSH key works from CMD line not script

OK , .. This is an odd one. I have a new server and I need to have a tunnel open to it. I have this exact process running on a few others but this new one I just got is not allowing the script to connect. I set up my users account and ssh keys from the server that will host the tunneling i... (6 Replies)
Discussion started by: jeffsandman0035
6 Replies

6. Shell Programming and Scripting

SH script, variable built command fails, but works at command line

I am working with a sh script on a solaris 9 zone (sol 10 host) that grabs information to build the configuration command line. the variables Build64, SSLopt, CONFIGopt, and CC are populated in the script. the script includes CC=`which gcc` CONFIGopt=' --prefix=/ --exec-prefix=/usr... (8 Replies)
Discussion started by: oly_r
8 Replies

7. Windows & DOS: Issues & Discussions

Getting mad at different CMD / Batch behaviour

I have these commands: MOVE "C:\Users\Pascal\Dropbox\Public\U_PC_Backup\Anki Flashcards\Cameo_App_Virtualization\0backup\Cards_only\Card_Backup\" "C:\Users\Pascal\Dropbox\Public\U_PC_Backup\Anki Flashcards\Cameo_App_Virtualization\0backup\Cards_only\Card_Backup_%date%\" xxcopy /E /Y... (2 Replies)
Discussion started by: pasc
2 Replies

8. Shell Programming and Scripting

Works on command line but not in script

OSX 10.9 I am building a script that evaluates the difference between 2 files. Here is a command that does not work transparently. Running this command in Terminal yields great results; however when I put that line in a .sh script, I get the errors shown below. Am I doing something silly? ... (1 Reply)
Discussion started by: sudo
1 Replies

9. Shell Programming and Scripting

Perl error in batch command but works one at a time

In the below perl executes if one file is processed perfect. However, when multiple files are processed in batch which is preferred I get the below error that I can not seem to fix it as the '' necessary for the command to execute, but seem to only work for one -arg option. Thank you :). ... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. Shell Programming and Scripting

Command works at command line but not from cron

Oracle Linux 6. Trying to set up a simple monitoring of memory usage. This command does exactly what I want at the command line: echo $(date +%Y-%m-%d" "%H:%M:%S) $(grep PageTables /proc/meminfo) >> /home/oracle/meminfo.logBut when I put it in my crontab: * * * * * echo $(date +%Y-%m-%d"... (2 Replies)
Discussion started by: edstevens
2 Replies
ipsec_config_batch(1M)													    ipsec_config_batch(1M)

NAME
ipsec_config_batch - allow for processing of IPsec config operations in a single batch file SYNOPSIS
batch_file_name profile_file] DESCRIPTION
The command allows you to specify multiple and operations in a single batch file for processing. HP-UX IPSec processes the operations in a batch file as a group. This mode is useful if you are adding or deleting configuration records that may affect other records. If one operation is invalid, all operations in the batch file fail. The utility first verifies each operation in the batch file for syntax errors and collisions (object names and priority values) with existing entries in the configuration database. If all operations in the batch file are valid, the HP-UX IPSec infrastructure updates the configuration database with all operations at the same time. If HP-UX IPSec is active and running, the HP-UX IPSec infrastructure also updates the runtime policy database. Options and Operands The batch operation recognizes the following options and operands: batch_file_name The name of the batch file containing and operations. A batch file cannot contain operations that operate on the following objects: For example, the operation is illegal in a batch file. In addition, a batch file cannot contain the following commands: o does not allow recursive batch files) or commands. o o Lines starting with a pound sign are interpreted as comments. Comment lines within an operation are not allowed. Maximum length: 1023 characters. Default: None. The utility verifies the and operations, but does not add or delete entries in the configuration database. This option applies to all operations in the batch file. Individual operations in the batch file cannot specify the option. Specifies the name of the profile file containing default argument values for this policy. The argument values are evaluated once, when the policy is added to the configuration database. Val- ues used from the profile file become part of the configuration record for the policy. This argument applies to all operations in the batch file. Individual operations in the batch file cannot specify the profile argument. Maximum length: 1023 characters. Default: EXAMPLES
The file contains the following entries: AUTHOR
was developed by HP. FILES
configuration database. default profile file. SEE ALSO
ipsec_admin(1M), ipsec_config(1M), ipsec_config_add(1M), ipsec_config_delete(1M), ipsec_config_export(1M), ipsec_config_show(1M), ipsec_migrate(1M), ipsec_policy(1M), ipsec_report(1M). HP-UX IPSec Software Required ipsec_config_batch(1M)
All times are GMT -4. The time now is 06:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy