Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Need help with .bat file!

Original Message
Name: ducklips
Date: April 29, 2004 at 10:58:34 Pacific
Subject: Need help with .bat file!
OS: dos
CPU/Ram: latitude c540/640
Comment:
Does anyone knoe of a good net tutorial on how to write a good .bat file? I have a tricky challenge to accomplish. I suppose what I am looking for is a list of commands, hopefully a rather in-depth one.

Usually google will transform my pc into the "bat-computer" and help me find just about anything, but in this case I need the help of some experts. From what I have learned, this is the place to find some good saavy people.

Any help would be much appreciated. Thanks!

-Ducklips

"i woke up this morning and all of my stuff was stolen and replaced with exact duplicates."


Report Offensive Message For Removal


Response Number 1
Name: jboy
Date: April 29, 2004 at 11:40:31 Pacific
Subject: Need help with .bat file!
Reply: (edit)
Here's Secret_Doom's site - plenty of ready made examples.

Something more basic

A gajillion hits on Google

If you could be more specific, someone may be able to advise.


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk.


Report Offensive Follow Up For Removal

Response Number 2
Name: ducklips
Date: April 29, 2004 at 12:54:35 Pacific
Subject: Need help with .bat file!
Reply: (edit)
Thanks Jboy! Your search did bring up many more results. I was typing in ".bat" instead of "batch".

Basically, I'm trying to figure out how to get a batch file to do a "run as" action, then enter an administrator user name and password to start a program when a restricted user logs on. The app that I want to start can only be started by an administrator but i don't want the restricted user to have admin priv's.

Does that make sense? Thanks again for the above info, I have learned a lot more.

"i woke up this morning and all of my stuff was stolen and replaced with exact duplicates."


Report Offensive Follow Up For Removal

Response Number 3
Name: Nigel Spike
Date: April 29, 2004 at 13:32:11 Pacific
Subject: Need help with .bat file!
Reply: (edit)
Administrator, restricted user, admin priv's, what version of DOS are you talking about?

Nigel


Report Offensive Follow Up For Removal

Response Number 4
Name: ducklips
Date: April 29, 2004 at 13:51:24 Pacific
Subject: Need help with .bat file!
Reply: (edit)
Hi Nigel,

It is an XP workstation but I found no help in the xp forum. I'm using whatever version of DOS that is on XP Pro. I am also using Windows 2003 Server, the user will be logging onto a domain on that server. I am not up to anything negative, I just need to initiate a scanning program that needs to always be running, and I'm not about to give administrative privileges to anyone that does not need it, which is why I'm trying to get this to work.

I just found this vb code below that I might be able to call into my batch file:

'RunAs Helper
'Syntax: runas.vbs <username> <password> <command>
'
set args=wscript.arguments
username = args(0)
pass = args(1)

'Get the command arguments
for i=2 to args.count - 1
command = command & args.item(i) & " "
Next

'Used for testing
'wscript.echo "runas.exe /user:" & username & " """ & command & """"
set shell=wscript.createobject("Wscript.shell")

'Run runas.exe
shell.run "runas.exe /user:" & username & " """ & command & """"

'Wait for runas.exe to load, this time could be shorter, but is set to 1000
to be safe
wscript.sleep(1000)

'Send the password and hit enter
shell.sendkeys pass & "{ENTER}"

'end of script

Do you think this will work?

"i woke up this morning and all of my stuff was stolen and replaced with exact duplicates."


Report Offensive Follow Up For Removal

Response Number 5
Name: Nigel Spike
Date: April 29, 2004 at 14:05:48 Pacific
Subject: Need help with .bat file!
Reply: (edit)
Sorry, way over my knowledge (and really not DOS), so I can't tell if it would work. Hopefully someone comes along who can tell.
Risk is they will send you right back to the XP forum.

Anyway, good luck
Nigel



Report Offensive Follow Up For Removal


Response Number 6
Name: flimflam
Date: April 29, 2004 at 14:25:13 Pacific
Subject: Need help with .bat file!
Reply: (edit)
JW has asked that NT Batch questions are not asked in an inappropiate forum.

You can not use the MSDOS in XP as it does not have any, will never have any and I would be pleased if everybody got this into their skulls. XP is based on IBM OS/2, NT3, NT4, W2K and therefore a 32bit O/S with an intergrated GUI, totally unlike MSDOS

Even Linux in command line looks similar to MSDOS, but it is Linix, please will all you NT users please read and digest the following article as it explains why NT is not MSDOS and MSDOS is an emulation:

http://www.computing.net/windowsxp/wwwboard/forum/103161.html


Report Offensive Follow Up For Removal

Response Number 7
Name: jboy
Date: April 29, 2004 at 14:43:20 Pacific
Subject: Need help with .bat file!
Reply: (edit)
Yeah - it's a source of confusion to many computer users. The command prompt in XP is basically the NT command interpreter - on the surface, very similar to 'classic' DOS, but the nuts & bolts are very different.

It's become something of a bone of contention in this forum, as the majority of the posts seem to be in regard to XP/2K 'DOS' - which is one reason why it's helpful to put the correct specs in the OS field when posting.

Some of that is addressed at Secret_Doom's page, but for complex batch files you need to use the specific features for your particular Operating System.

XP command Reference


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk.


Report Offensive Follow Up For Removal

Response Number 8
Name: Wengier
Date: April 29, 2004 at 14:48:14 Pacific
Subject: Need help with .bat file!
Reply: (edit)
You can also ask NT Batch questions in Programming Forum besides the NT/2K/XP Forum (or even the OS/2 Forum), but NEVER in the DOS Forum!

OS/2 was originally a joint project between MS and IBM. After their collaboration fell apart, WinNT was renamed from MS's version of OS/2 by MS (while IBM's version of OS/2 was later renamed to OS/2 Warp by IBM); Win2K and WinXP are WinNT 5.0 and WinNT 5.1 respectively. Please read here for more information about Windows NT:

http://www.sciencedaily.com/encyclopedia/microsoft_windows_nt

---------------
Long Live DOS!


Report Offensive Follow Up For Removal

Response Number 9
Name: ducklips
Date: April 29, 2004 at 15:08:57 Pacific
Subject: Need help with .bat file!
Reply: (edit)
Thanks for the help and your patience with my learning curve. I belong mainly in 3D animation and web design but I have been working more and more with workstations and networking which forced me to build and maintain a network environment.

this is a link to a 3D contest that I'm in for fun and I'll post my latest web work below that.

http://www.cgtalk.com/showthread.php?s=2169c6d44bcbf5ff7c7dc21dfc0cc430&postid=1225214#post1225214

www.recordexpressllc.com (my last site)

I'll aim to get help in the other forums but thanks again for your guidance and patience in this one.

By the way Flimflam, feel free to visit www.prozac.com

Once i get this figured out I'll post the solution here again in case you guys ever run into something like this.

take care-

-Ducklips

"i woke up this morning and all of my stuff was stolen and replaced with exact duplicates."


Report Offensive Follow Up For Removal

Response Number 10
Name: jboy
Date: April 29, 2004 at 15:40:01 Pacific
Subject: Need help with .bat file!
Reply: (edit)
That's some interesting work - I was a big fan of Heavy Metal mag and the various Undergrounds from the 70's & 80's.

Sure, look around the other forums a give your question a try there - I'm not too surprised there wasn't much help in the actual XP forum - I get the impression that most of the helpers there aren't much more knowledgeable than most of the questioners (but what do I know?)

Good luck

The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk.


Report Offensive Follow Up For Removal

Response Number 11
Name: flimflam
Date: April 30, 2004 at 02:32:13 Pacific
Subject: Need help with .bat file!
Reply: (edit)
thankyou ducklips and look forward to you posting back in the appropiate forum in the future.

btw, I do not like Prozac prefer Fluoxetine myself............


Report Offensive Follow Up For Removal

Response Number 12
Name: uli_glueck
Date: May 2, 2004 at 23:02:59 Pacific
Subject: Need help with .bat file!
Reply: (edit)
Hi all,

it is true, to get the information you want for Batches,in the NT Forum is like gambling. It seems the most know how is in the DOS Forum.

A stupid question from me:
I know the NT Konsole is different than the Dos Konsole, but most batch scripts are also working with NT.
So where is the problem to give people help if they donīt get it in Windows or Programmers Forum?

greetings
uli


Report Offensive Follow Up For Removal

Response Number 13
Name: jboy
Date: May 2, 2004 at 23:34:04 Pacific
Subject: Need help with .bat file!
Reply: (edit)
uli - I think you misunderstand. It's not like we're witholding help.

Generally speaking, the contributers here in the 'old' DOS forum are familiar with DOS, not NT. If someone can help, they will - but it seems a little unfair to expect folks to give advice or instructions concerning Operating Systems that they have little or no experience with.

It's also a matter of policy to separate the various forums (mainly) by Operating System - this simplifies the use of the 'site search' feature.


We don't post DOS questions over in the NT forum, now do we?

; )

The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk.


Report Offensive Follow Up For Removal

Response Number 14
Name: Wengier
Date: May 3, 2004 at 12:50:44 Pacific
Subject: Need help with .bat file!
Reply: (edit)
Besides what jboy had said in the above response --

a quotation from uli's post:

"most batch scripts are also working with NT"

Not true. The fact is: A lot of advanced DOS batch scripts will NOT work with NT, while most NT batch scripts will NOT work with DOS. In particular, NT batch scripts are generally incompatible with DOS systems. Read this page for more information:

http://www.batch.hpg.ig.com.br/

---------------
Long Live DOS!


Report Offensive Follow Up For Removal

Response Number 15
Name: Mikekirgan
Date: May 10, 2004 at 08:54:52 Pacific
Subject: Need help with .bat file!
Reply: (edit)
Ducklips...have you found a solution to your problem?...I have the same problem so let me know if you come up with anything!

Thanks


Report Offensive Follow Up For Removal



Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Need help with .bat file!

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




acer 312T BIOS problem

K7 Turbo possible max fsb?

Pc anywher problem

WinFLP & OE/Outlook2003

Computer resets after a few minutes


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC