Search found 23 matches

by djangofan
29 Nov 2012 21:12
Forum: DOS Batch Forum
Topic: A .profile script for DOS shell
Replies: 2
Views: 3343

Re: A .profile script for DOS shell

I ran into an issue with this script. Here is my revised script: m The problem is that it works on some Windows 7 machines but not all of them. The registry entries look fine, but on one of my Windows 7 machines , when I open a command prompt, it doesn't seem to read the AutoRun key in the registry....
by djangofan
28 Nov 2012 17:51
Forum: DOS Batch Forum
Topic: A .profile script for DOS shell
Replies: 2
Views: 3343

A .profile script for DOS shell

I created a .profile script for DOS shell. I wanted to share it: @ECHO OFF ECHO Loading additional commands from: ECHO %0 ECHO Type 'DOSKEY /MACROS:ALL' to see the configured commands. :: to install, place this .bat script in the location you want :: it to reside and then run this batch script with ...
by djangofan
27 Sep 2012 10:37
Forum: DOS Batch Forum
Topic: Batch file that creates MSSQL database and users
Replies: 0
Views: 6918

Batch file that creates MSSQL database and users

I created a batch file that creates MSSQL database and users. Would love it if someone could fork my code (on Gist at GitHub) and improve my script. The idea behind this script is to create a database with a "user schema" so that multiple users can use the same database because tables can ...
by djangofan
19 Jan 2012 17:14
Forum: DOS Batch Forum
Topic: Handling property files in a DOS batch script.
Replies: 5
Views: 6669

Re: Handling property files in a DOS batch script.

Thanks. By adding this to the top of the file, I was able to get it working: @echo off &SETLOCAL ENABLEDELAYEDEXPANSION More specifically, the "SETLOCAL" is what made the difference. Also, i had to change TYPE.exe to just "TYPE" . Find.exe and Findstr.exe worked fine when cal...
by djangofan
17 Jan 2012 14:32
Forum: DOS Batch Forum
Topic: Can a batch script run from a network share location?
Replies: 5
Views: 6495

Re: Can a batch script run from a network share location?

Ed Dyreen wrote:'
You are already doing it :!:


I don't think so. If I go into a any more complex example, such as using COPY.exe, then it fails to copy with a similar error. Therefore, I am wondering what the secret is, as I currently do not believe it is possible.
by djangofan
17 Jan 2012 13:31
Forum: DOS Batch Forum
Topic: Can a batch script run from a network share location?
Replies: 5
Views: 6495

Can a batch script run from a network share location?

Is it possible to run a batch file from a network share location? For example, I have this script: @ECHO off ECHO Hello World pause And it results in output that looks like this: '\\demo.mysite.com\c$\SharedFiles\Batch' CMD.EXE was started with the above path as the current directory. UNC paths are ...
by djangofan
14 Jan 2012 13:20
Forum: DOS Batch Forum
Topic: Handling property files in a DOS batch script.
Replies: 5
Views: 6669

Re: Handling property files in a DOS batch script.

I simplified my question as much as I could. Here is the output from the file now: The system cannot find the file specified. Error occurred while processing: .exe. test.properties.bak The system cannot find the file specified. Error occurred while processing: .exe. test.properties.bak --- Finished ...
by djangofan
12 Jan 2012 10:53
Forum: DOS Batch Forum
Topic: Verify a string exists within another string?
Replies: 9
Views: 8625

Re: Verify a string exists within another string?

@Aacini - just when I thought I had mastered batch scripts, the rabbit hole gets even deeper. Thanks for the reference to Macros.
by djangofan
11 Jan 2012 22:27
Forum: DOS Batch Forum
Topic: Useful tool testing "SET /P" reading each line in a file.
Replies: 4
Views: 6149

Re: Useful tool testing "SET /P" reading each line in a fil

@Aacini - I had to modify your code a bit to get it to work: @echo off if not exist pipe.com call :CreatePipe for /F "USEBACKQ delims=" %%i in (`pipe.com ^< %1`) do ( echo(%%i ) goto :EOF :CreatePipe setlocal DisableDelayedExpansion set pipe=´)€ì!Í!ŠÐŠà€Ä!€ü.t2€ü+u!:æu8²A€ê!´#€ì!Í!².€ê!´#€...
by djangofan
11 Jan 2012 14:02
Forum: DOS Batch Forum
Topic: Useful tool testing "SET /P" reading each line in a file.
Replies: 4
Views: 6149

Re: Useful tool testing "SET /P" reading each line in a fil

You mention a problem about FIND and FINDSTR not working when confronted with a file with blank lines. The key is to use something like this: FOR /F "USEBACKQ delims=" %%A IN (`TYPE.exe "%_FILE%" ^| FIND.exe /V /N ""`) DO ( SET "LN=%%A" SETLOCAL ENABLEDELAYEDE...
by djangofan
10 Jan 2012 16:50
Forum: DOS Batch Forum
Topic: Verify a string exists within another string?
Replies: 9
Views: 8625

Re: Verify a string exists within another string?

Thanks Squashman and dbenham . I wouldn't have imagined 2 different ways of doing it. Thank you!
by djangofan
10 Jan 2012 11:51
Forum: DOS Batch Forum
Topic: Verify a string exists within another string?
Replies: 9
Views: 8625

Re: Verify a string exists within another string?

Thank you thank you thank you! I was looking for an idea like that one. ;-)
by djangofan
10 Jan 2012 11:41
Forum: DOS Batch Forum
Topic: Verify a string exists within another string?
Replies: 9
Views: 8625

Verify a string exists within another string?

If I have a string , containing all of my concatenated args to my batch script, that looks like this: "-debug -verbose -normi -homedir -repo" Is there a way to verify that "-verbose" exists within that string without using a space-delimmetted FOR loop to compare each token? Basic...
by djangofan
09 Jan 2012 12:47
Forum: DOS Batch Forum
Topic: For this forum: syntax highlighting in the style of DOS
Replies: 0
Views: 6607

For this forum: syntax highlighting in the style of DOS

Is it possible to modify the <CODE> tag in this forum so that it understands DOS batch scripts and can highlight the correct keywords? This post on this forum suggests that it is possible:

http://www.phpbb.com/community/viewtopi ... &t=2120153
by djangofan
09 Jan 2012 12:38
Forum: DOS Batch Forum
Topic: Handling property files in a DOS batch script.
Replies: 5
Views: 6669

Handling property files in a DOS batch script.

I created this test script to handle property files in DOS batch scripts. The scripts works fairly well as-is but I am hoping for any tips that anyone might have for improving it? NOTE: On the PROPEDIT function, there is an error that I am unable to figure out : The system cannot find the file speci...