You are here

batch file help

18 posts / 0 new
Last post
powerjuce
powerjuce's picture
Offline
Last seen: 13 years 9 months ago
Developer
Joined: 2007-09-20 21:34
batch file help

hi i running a batch file that opens a program and then deletes itself. however after the batch file runs the program it does not go to the next command
Ex.
syscontrol.exe
del set.bat

Syscontrol opens up without a window could that be the problem?

wraithdu
Offline
Last seen: 11 years 6 months ago
Developer
Joined: 2007-06-27 20:22
How are you launching the

How are you launching the program? The correct way to do it would be -

start "" /b "path\to\syscontrol.exe"

powerjuce
powerjuce's picture
Offline
Last seen: 13 years 9 months ago
Developer
Joined: 2007-09-20 21:34
just typing it in

the program was in the same folder so all I did was type the program name in

Please search before posting. ~Thanks

wraithdu
Offline
Last seen: 11 years 6 months ago
Developer
Joined: 2007-06-27 20:22
Ok, so start "" /b

Ok, so

start "" /b syscontrol.exe

will work.

powerjuce
powerjuce's picture
Offline
Last seen: 13 years 9 months ago
Developer
Joined: 2007-09-20 21:34
thanks now...

i want to copy a folder but there is another folder inside of it
the copy command does not copy that folder and its contents.
can you help me with that?

Please search before posting. ~Thanks

BuddhaChu
BuddhaChu's picture
Offline
Last seen: 5 months 2 weeks ago
Joined: 2006-11-18 10:26
xcopy

Use xcopy with the /S switch.

"xcopy /?" for more info.

robocopy is another option -- Google it.

Cancer Survivors -- Remember the fight, celebrate the victory!
Help control the rugrat population -- have yourself spayed or neutered!

powerjuce
powerjuce's picture
Offline
Last seen: 13 years 9 months ago
Developer
Joined: 2007-09-20 21:34
thanks again

one last last question
how would you delete a folder completly
even if there are other folders within it?

Please search before posting. ~Thanks

wraithdu
Offline
Last seen: 11 years 6 months ago
Developer
Joined: 2007-06-27 20:22
you would search for help

rmdir /s

Here, references for you -

Start -> run -> hh ntcmds.chm (WinXP Pro)
and
http://www.ss64.com/

powerjuce
powerjuce's picture
Offline
Last seen: 13 years 9 months ago
Developer
Joined: 2007-09-20 21:34
i looked at the site, however

can you use the start command to run a file that is a a hidden and system file?

Please search before posting. ~Thanks

wraithdu
Offline
Last seen: 11 years 6 months ago
Developer
Joined: 2007-06-27 20:22
Dunno, why don't you try and

Dunno, why don't you try and report back!

powerjuce
powerjuce's picture
Offline
Last seen: 13 years 9 months ago
Developer
Joined: 2007-09-20 21:34
I tried and it worked for

I tried and it worked for some .exe's but not for others.
um..
I hav another question, but this time i researched
I know tat you can use the AT command to start tasks at certain times
Ex.
AT 20:00 /interactive firefox.exe
^
|
rather than putting a time right there can we hav it so that when you log on firefox will launch?
thanks

Please search before posting. ~Thanks

wraithdu
Offline
Last seen: 11 years 6 months ago
Developer
Joined: 2007-06-27 20:22
For that I would just put a

For that I would just put a shortcut to firefox in the user's startup folder. Or a shortcut to your BAT file in the user's startup folder. Otherwise you could try something with the windows logon scripts, but I don't know much about that.

BuddhaChu
BuddhaChu's picture
Offline
Last seen: 5 months 2 weeks ago
Joined: 2006-11-18 10:26
schtasks > at

The shortcut idea is the best.

For task scheduling, don't use "at", use "schtasks"

'schtasks /?' and 'schtasks /create /?' for a bunch of info and then Google what you don't understand. There's ton of info out there on that program.

Cancer Survivors -- Remember the fight, celebrate the victory!
Help control the rugrat population -- have yourself spayed or neutered!

powerjuce
powerjuce's picture
Offline
Last seen: 13 years 9 months ago
Developer
Joined: 2007-09-20 21:34
new question

i need to find an ip address within a file.
However i do not no the IP address
how would I do that?

Please search before posting. ~Thanks

BuddhaChu
BuddhaChu's picture
Offline
Last seen: 5 months 2 weeks ago
Joined: 2006-11-18 10:26
vbscript regex

Write some VBScript to read in the file line by line and do a regex looking for an IP pattern.

Cancer Survivors -- Remember the fight, celebrate the victory!
Help control the rugrat population -- have yourself spayed or neutered!

wraithdu
Offline
Last seen: 11 years 6 months ago
Developer
Joined: 2007-06-27 20:22
You're using BATCH

You're using BATCH (obviously), so try the

findstr

command. It can make use of regular expressions to search any ASCII file line by line, and returns the line(s) that contain(s) the string. This behavior can be altered through the commandline switches.

Riax
Riax's picture
Offline
Last seen: 9 years 6 months ago
Joined: 2007-09-06 14:41
With all the help provided

With all the help provided in the comments above, this may not help you much, but it's certainly something you should check out if you're not very familiar with writing batch files. I stumbled across it whilst seeking help with a batch file of my own. It didn't answer my question at the time, but I've since referenced it a few times in writing more batch files.

http://www.computerhope.com/batch.htm

You could also Google "batch file help" to find more resources. The link I gave is the first result, and from what I see in the first few pages, it's also pretty thorough.

Her song leaves the other side in flight for their lives now;
They are not long for the world.
No one leaves; line up for inevitable wipeout.
All you've done - now it's what you deserve.
Machinae Supremacy ~ Laser Speed Force

wraithdu
Offline
Last seen: 11 years 6 months ago
Developer
Joined: 2007-06-27 20:22
I'm sure I posted it above

I'm sure I posted it above somewhere, but here's the 2 resources I use. The help file is only available in WinXP Pro.

Start -> Run -> hh ntcmds.chm
or
http://www.ss64.com/

Log in or register to post comments