|
-
August 28th, 2008, 08:31 AM
#1
trying to inventory our computers
Hello,
I have been reading through the forums for a while and received some great advice. But I'm working on this one project and can't seem to get it right. I'm very new to scripting (only been doing it a few weeks) and can't figure out why this script is acting like it does. The script is
Code:
@echo off
If exist c:\inventoried goto A
md c:\inventoried
systeminfo /nh /fo csv >> N:\is\scripts\inventory\inventory.csv
cscript n:\is\scripts\inventory\servicetag.vbs >> n:\is\scripts\inventory\servicetags\%computername%.txt
goto A
:A exit
When it runs the first time one a computer it will bypass the if statement and create the folder "c:\inventoried", but then it will exit. If you go in and delete the folder it will go through and do the script correctly. I have tried this on 6 different machines and gotten the same reaction each time. The problem with having to go in and manually delete a folder for it to work is we need to run this on a little over 300 computers and don't want to have to physically touch all of them. Do you guys have any suggestions on why the code may be acting the way it is? Thanks in advance for your help.
Edited: to put in code boxes.
Last edited by sbevill7; August 28th, 2008 at 08:52 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|