WMI - Rename Network File
If I set the iTest variable to 1, my script renames a file called
"c:\temp\myDatabase.mdb" to "c:\temp\myDatabase.bak". However, if I set my
iTest variable to 2 and try to rename
"\\myComputer\c\backup\databases\myDatabase.mdb" to
"\\myComputer\c\backup\databases\myDatabase.bak", nothing happens. No errors
come up, but the .bak file doesn't get created.
Does WMI have a limitation of not being able to rename networked or UNC path
files? Is there a workaround? I can't use the FSO method because of
virus-warnings, so I'm trying to find a WMI Script to rename a network file.
CODE ******************
Dim sFile, sFileBackup, sFolderTarget, sDriveTarget
Dim objShell, objFile, sFileTarget
Set objShell = CreateObject("Shell.Application")
dim iTest
iTest=2
sFileBackup="myDatabase.bak"
sFile="myDatabase.mdb"
If iTest=1 Then
sDriveTarget="c:\"
sFolderTarget = "temp"
ElseIf iTest=2 Then
sDriveTarget="\\myComputer\c\backup\"
sFolderTarget = "databases"
End If
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}\\" & strComputer &
"\root\cimv2")
sFileTarget = sDriveTarget & sFolderTarget & "\" & sFile
sFileTarget = Replace(sFileTarget , "\", "\\")
Set colFiles = objWMIService.ExecQuery _
("Select * from Cim_Datafile where Name = " _
& "'" & sFileTarget & "'")
For Each objFile in colFiles
errResult = objFile.Rename(sDriveTarget & sFolderTarget & "\" &
sFileBackup)
Next Tag: copying files Tag: 195066
Error Handling
Hopefully this should be an easy one for someone.
Does anyone know how to revert back from the "On error resume next".
I want to be able to at a certain point turn this off and then back on
and so on.
Thanks Tag: copying files Tag: 195064
Everyone wants money for their code... Why?
Coming from the world of OSS I'm abit confused while I'm trying to
learn Visual Basic Scripting. It seems everyone wants money for code
to do things I'd assumed were built-in features. For example, I'm
trying to write a script to query an MS SQL database and print the
details, and in research I found a script which does almost this --
except it emails the results instead of prints them. I thought, what a
wonderful thing to have, so I started working with the script to learn
VBScript. Here's the site: http://www.sqlteam.com/item.asp?ItemID=5908
Well it appears this script uses code from a company called
ServerObjects http://www.serverobjects.com/ which wants money to use
their ASPMail program. The example mentions another company which also
wants to dip into the wallet to use their code. I've ran across this
while working in Sharepoint also, and it seems all the many features I
assumed Sharepoint and now VBS would have outta the box but doesn't
have been written by third-party companies who want a good chunk of
change to add. For me while learning and experimenting I can't shell
out money everytime I want to learn how to do a new programming task.
Why does it cost to get this code? Why don't more open source
programmers write and share wonderful code as they do in other areas of
coding? I'm seriously trying to learn more Microsoft programming
languages, but it seems every bend in the road someone wants to dip
into my wallet.
Sorry for such an email, but it is quite frustrating...
Thanks for the listen, and I promise I'm off my soap box :) Just had
to ask though.
Alex Tag: copying files Tag: 195060
PopUp Days event
Hi,
I want a help in creating a logon script.
I have windows 2003 domain and clients XP-SP2.
There is a group policy set to display the Company security information
before the login window.
Now the management wants me create a login script which will POPUP Days
Event as soon as users logs in and thereafter that Days Event should be the
Default screen saver through out the day.
Is it possible to attain this task
thanks for any help in this respect
Regards
SK Tag: copying files Tag: 195059
Printing data from MS SQL to various printers
Hi everyone,
I'm a seasoned programmer, but I've yet to touch VBScript. I want to
write a script that will query a database and print contents to a
printer based on entries within the database. So for example I'd have
the following printers setup on the workstation:
\\printsvr\marketingptr
\\printsvr\hrptr
\\printsvr\itptr
And the database might have a table similar to this:
PrinterName ContentBody
marketing THis is a test message for Marketing
hr THis is a test message for Human Resources
it This is a test message for Information
Technology
When the script runs it will parse the database table and print the
content to the specific printer. This is of course a simple example,
I'll probably have a table linking the PrinterName to the Printer UNC,
but you get the idea of what I'm trying to do.
I have no working knowledge of VBScript, so I'm not even sure if this
is possible, or if so what commands I'll need to use. If someone has a
script that does this, I'd love to take a gander, but if someone can
point me in the right direction with commands to research, that'd be
wonderful. The two components I know I need are a component to hit the
database (which is Microsoft SQL 2000) and a component to print to the
specified printer (which will all be setup on the local workstation).
Thanks again for any assistance...
Alex Tag: copying files Tag: 195058
WMI not starting when joined to the domain
Hello All,
Whenever I try to run a script on a PC that's joined to my domain it
will return an error: "Permission denied: 'GetObject'" I am a local
administrator on this box so it shouldn't be a problem and scripts do
work when i'm not on the domain. Another thing i've noticed is that
once joined to the domain I can't browse the WMI control in the
computer management console.
Any help will be appreciated. Tag: copying files Tag: 195057
how to set Object Extended Security Permissions
People,
I'm in a situation where I need to check for and then grants rights for
"Write Personal Information" to the SELF account on all User Accounts
with a Domain
Does anyone know how to acheive this and are there any comprehensive
guides for Security Permissions in general?
Many thanks!
Neil Tag: copying files Tag: 195055
Assigning Default printers to clients using AD and vbs
I am running a Server 2003 and Win XP network, for a school, and we
used to use BAT files on the client machines to specify printers for
each PC depending on their room. However I am now trying to move all of
this over to vbs scripts applied by group policies to the machines.
I have set up OU's in active directory for each of our computer labs,
and have placed the PC's from each lab in those OU's. I am then
appllying the script qouted below, to the "user configuration \ windows
settings \ scripts \ Logon" part of a Group Policy to each computer lab
OU.
If i run the script locally on a PC it works fine, but it will not set
the printer for me when I log on to a machine. Any ideas as to what I
am doing wrong would be great.
-------------------------------------------------------------------------------------------------------
set wshNetwork = CreateObject ("WScript.Network")
'deletes all network printers
Set clPrinters = WshNetwork.EnumPrinterConnections
On Error Resume Next
For i = 0 to clPrinters.Count - 1 Step 2
wshNetwork.RemovePrinterConnection clPrinters.Item(i+1), true
Next
On Error Goto 0
'maps new printers.
wshNetwork.AddWindowsPrinterConnection "\\print\H11Print"
'sets default printer.
wshNetwork.SetDefaultPrinter "\\print\H11Print"
------------------------------------------------------------------------------------------------------ Tag: copying files Tag: 195052
Create a Web Service object with VBS
Hi
I have some troubles. I should call a webservice and frome there i should
create authentication object for calling other services.
Is there a way to do that with vbs and the ms soap object?
I posted an .Net example, to understand how it would work:
using System;
using ConsoleApplication1;
namespace ConsoleApplication1
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
// string docbase = "comlog";
string docbase = "pwm_zu";
loginservice.DocbaseCredentialsService crServ = new
loginservice.DocbaseCredentialsService();
loginservice.DocbaseCredentialsInfo info = new
loginservice.DocbaseCredentialsInfo();
// info.docbaseName = "docbase1";
// info.user = "Name1";
// info.password = "*******";
info.docbaseName = "docbase2";
info.user = "name2";
info.password = "*******";
String token = crServ.newCredentials(info, true);
account.MSAccountService acService = new account.MSAccountService();
account.DocumentumSecurityToken acToken = new
account.DocumentumSecurityToken();
acToken.token = token;
acService.DocumentumSecurityTokenValue = acToken;
string accountId = "1111111";
try
{
account.Document[] docs = acService.getDocumentsOfAccount(docbase,
accountId, "false");
foreach(account.Document doc in docs)
{
System.Console.WriteLine(doc.docIndexNo);
System.Console.WriteLine(doc.objectId);
System.Console.WriteLine(doc.documentDescr);
System.Console.WriteLine(doc.createdDate);
System.Console.WriteLine(doc.creationOwner);
System.Console.WriteLine(doc.versionLabel);
System.Console.WriteLine("------------------------------------");
try
{
byte[] data = acService.getContentXferBase64(docbase, doc.objectId);
if(data!=null)
{
string s = base64Decode(data);
Console.WriteLine("Contentsize: " + s.Length);
}
}
catch(System.Web.Services.Protocols.SoapException err)
{
PrintSoapExceptionInfo(err);
}
}
string xml = acService.getDocumentsOfAccountAsXml(docbase, accountId,
"false");
Console.WriteLine(xml);
xml = acService.getDocumentTypesOfAccountAsXml(docbase, accountId,
"1-AO", "false");
Console.WriteLine(xml);
System.Console.WriteLine("Ende");
}
catch(System.Web.Services.Protocols.SoapException err)
{
PrintSoapExceptionInfo(err);
}
}
private static void
PrintSoapExceptionInfo(System.Web.Services.Protocols.SoapException err)
{
System.Console.WriteLine(err.Message);
System.Console.WriteLine(err.StackTrace);
System.Console.WriteLine(err.Detail.InnerText);
Exception e = err.InnerException;
while(e!=null)
{
System.Console.WriteLine(err.Message);
System.Console.WriteLine(err.StackTrace);
e = e.InnerException;
}
}
public static string base64Decode(Byte[] data)
{
try
{
System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
System.Text.Decoder utf8Decode = encoder.GetDecoder();
char[] ca = new char[data.Length];
for(int i=0;i<data.Length;i++)
{
ca[i] = (char)data[i];
}
byte[] todecode_byte = Convert.FromBase64CharArray(ca,0,ca.Length);
int charCount = utf8Decode.GetCharCount(todecode_byte, 0,
todecode_byte.Length);
char[] decoded_char = new char[charCount];
utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length,
decoded_char, 0);
string result = new String(decoded_char);
return result;
}
catch(Exception e)
{
throw new Exception("Error in base64Decode" + e.Message);
}
}
}
} Tag: copying files Tag: 195047
How to set a public object variable?
Hi,
I want to create an object that named "objIE" with:
Set objIE = CreateObject("InternetExplorer.Application")
but i wish this object will available for other functions in my
application (vbs in hta).
I thought
Public Set objIE = CreateObject("InternetExplorer.Application")
may work.
Unfortunately it wasn't. How can i make an object public to make it
available for external functions.
Thanks.
Caglar ORHAN Tag: copying files Tag: 195046
export group content
ok. i am trying to create a script that exports the contect of a group to a
textfile..it should search ad when one doesnt know in which ou the group
resides. please see what i have done so fare cause i can use some help..am
stuck :-)
thanks.
On Error Resume Next
dim target
strdnsdomain="test"
' Bind to Active Directory
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("DefaultNamingContext")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set TextFile = FSO.OpenTextFile("C:\Info.txt", 2, True)
target=inputbox("Choose Attribute Name")
if target="" then wscript.quit 'user clicked cancel
Set objGroup = GetObject ("LDAP://cn="& target& strDNSDomain)
objGroup.getInfo
arrMemberOf = objGroup.GetEx("member")
For Each strMember in arrMemberOf
tempvarMember = tempvarMember & strMember & VbCrLf
Next
TextFile.WriteLine "members '" & target & "' are:" & VbCrLf & tempvarMember
wscript.quit Tag: copying files Tag: 195045
Browse password protected page from vbscript
Greetings.
For a project I need to do the following:
1. Open a URL,
2. send form with username/password to gain access
3. Identify in the page retrieved some html code (a table)
4. Continusouly get the same page and compare the table to identify changes}
Th main purpose its to be able to rapidly detect when a password protected
web page changes.
I have seen some sample code using the "MSXML2.ServerXMLHTTP" and the
"InternetExplorer.Application" object, but none of those I have seen
authenticating.
Any ideas?
Thanks in advance,
Camilo Arango Tag: copying files Tag: 195044
Create Multiple Exchange 2003 Mailboxes.
Is it possible to create Exchange 2003 mailboxes for all users in AD at once
using a vbs script instead of creating a mailbox for each user individually
one at a time? Would appreciate any help. Thanks. Tag: copying files Tag: 195039
WMI using a variable as the propertyname
Lo group,
The following is driving me crazy:
I have connected to WMI (Win32_BaseBoard) to get some info about my
motherboard. As long as I hardcode the propertyname (for example
objWMI.Manufacturer) everything works fine (displays Asus).
However, what I would like to do is use a variable containing the value
"Manufacturer" and use that instead of the hardcoded propertyname.
Simply put I want something like objWMI.strKeyName.
Can it be done ?!?
TIA,
SomeDude Tag: copying files Tag: 195034
Script to test whether there is media present in a removable tape drive?
I have a SCSI DAT tape drive on a Windows 2003 server.
I want to write a script that reports whether there is a tape inserted in
the drive or not.
I'm not sure if this is possible or not...
Can anybody assist with a pointer?
thanks in advance
--
Simon Verona Tag: copying files Tag: 195024
Creating a class to open a ssh tunnel
Hello NG,
I have searched the net for some answers, but nothing that was written for a
pure VBS.
What we have:
Several servers from customers connected via firewall to our
support-environment.
We only may go there using RDP or SSH for filetransfer.
We have some scripts, written in VBS, that collect data from a server and
send them direct to a MS SQL Server.
These only work if port 1433 is open though the firewall.
Now we have some customers, that permit 1433 throug the Firewall and many
hwho would like to remove this rule.
What I now need to do is do define a Class in our VBS, which opens a SSH
tunnel and lateron closes it.
It needs to be pure VBS, there may not be any third-party DLL or anything,
the customer cannot read in clear text -we wouldn't get approval for this.
We are using openssh server version 3v8 on both sides (ssh.exe).
Can somebody help me with this class. I have found many exambles using
visual basic but non of them were usable in vb script.
thanks in advance
Carsten
PS: i think of something like this:
class sshtunnel
public function openit()
....blablabla...
end function
public function closeit()
...blubblubblub...
end function
end class
set tunnel=new sshtunnel
tunnel.open()
...many lines doing something with the tunnel...
tunnel.close() Tag: copying files Tag: 195021
How to restore all active windows
I am trying to write a script to restore all open programs in windows
XP professional. I have come across the key shift+windows key+M
(script below), but it restores only windows that have previously been
minimized by windows key+M. Can anyone find a solution for me? I am a
newbie at windows scripting, so please describe solution in detail.
Thanks, Margie.
set WshShell = WScript.CreateObject("WScript.Shell")
WSHShell.SendKeys("^{ESC}+M") Tag: copying files Tag: 195017
ntfs permission
I am in the process to trying to come up with a script for look at access
right of particular user or group. what is the best way
I ma aware of file system objects, and somehow I guess I can use cacls or
equivalent and iterate folders, files.
for a given folder and its contents, if the permissions are inherited by its
files and subdirectories, I prefer not to list its files and subdirectories
but only exceptions
or is there already such scripts out there from Microsoft or whatever that
there is no point of me re-inventing from scratch? Tag: copying files Tag: 195003
For Each
Does For Each...Next always iterate through an array in the same order
(increasing from the first element to the last)?
Brian Tag: copying files Tag: 195002
password protection
I am writing a website using .asp with an Access Database backside. I
have a login process to access the database/website. I was wondering
if there is either a way in Access or VBScript to enforce exact
passwords. Right now it doesn't care if the password has upper case or
lower case letters.
Thanks
Jeremiah Thoman Tag: copying files Tag: 194996
connect to network drive
I have used this batch file format in the past to connect to network
drives. Even people who are under two different server clients, ie.
Novell and Windows Active Directory (AD).
For some reason this time it is not authenticating the user name.
Just some background so you might be able to understand what the
problem is..
User in different location and a Novell client but has access to AD.
For performance, the application was placed at the same location but on
an AD server.
The "aa/" d user domain may be different then the server. The IP
addresses for the two locations start with different #'s. Does that
matter?
Also the users are part of a group and have a generic password set for
the whole list of users.
net use y: /d
net use y: \\XXX.XX.XXX.XX\Folder /user:aa\dez1 P@ssword
any insight would be great.
thanks Tag: copying files Tag: 194995
DateDiff with special format.
Hello,
I'm trying to create a script that tells the difference between 2 dates
in the following format:
5 years, 4 months, 1 Week, 3 days, 7 hours, 3 minutes and 34 seconds.
This is what I have so far:
var1 = dateserial(2005, 01, 25)
var3 = now()
var3 = Datediff("s", var1, now_var)
but this yealds an answer only in seconds. I'm not sure where to go
from here any help is appricatied. Tag: copying files Tag: 194994
Returning the Err object from a function
Hi! :)
I want to return the err object from a function. How do I do this?
Do I have to create my own error class or is there a way to create an
instance/copy of the existing to return?
Thanks a million! :)
/Sofia Tag: copying files Tag: 194991
Terminate function?
Hi,
I have a script running as a service (using srvany.exe)
It runs fine and stops fine.
I want the script to run a few more commands when:
1. i stop the service
2. when the service crashes
Can anyone point me in the right direction (with examples maybe...) Tag: copying files Tag: 194988
Foldersize
Hi all,
how can I determine the foldersize using WMI
Perhaps someone has written such a script before that does this job and
knows what is wrong.
Thanks in advance
Helmut
Here is a code excerpt:
server = "myServer"
Set wmi = GetObject("winmgmts://" & server & "/root/cimv2")
Set basis = wmi.get("Win32_Directory.name='s:\myfolder'")
MsgBox basis.GetObjectText_ ' o.k.
Set klassen = basis.Associators_ (, "Win32_LogicalDisk", , , , , , , 32)
For Each klasse In klassen
list = list & klasse.size Next
MsgBox list Tag: copying files Tag: 194987
gather list of users in a query-based DL
Hi,
Has any one figured out a way to grab the list of user names from a query
based DL? I can use LDAP to pull it out of a normal DL, but I get an error
when trying to use the same method on a QBDL. Tag: copying files Tag: 194986
Dell Battery Recall
Hi,
Now that Dell is doing a recall of batteries for some laptop modells
(https://www.dellbatteryprogram.com/) and we do have about 60 of them
in different locations i was wondering if anyone have some info on how
to get the battery PPID (Dell Part Piece Identification) via script.
I have this so far but the only use i have is that the manufacturer is
Sony, which sure helps a lot.
---------------------------------------------------------------------
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer &
"\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_PortableBattery")
For Each objItem in colItems
Wscript.Echo "SystemName : " & objItem.SystemName
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "Device ID: " & objItem.DeviceID
Wscript.Echo "Location: " & objItem.Location
Wscript.Echo "Manufacturer: " & objItem.Manufacturer
Wscript.Echo "Name : " & objItem.Name
Wscript.Echo "Status : " & objItem.Status
Wscript.Echo
Next
-----------------------------------------------------------
I have tried with all items in the class Win32_PortableBattery:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_portablebattery.asp Tag: copying files Tag: 194985
How do I get a Script recogonize both uppercase and lower case letters..?
Sub Main()
If Extract <> "%lookupq1%"
Then
Email2DBSend = True
Else
Email2DBSend = False
End If
End Sub
Here "%lookupq1%" refers to both uppercase letters, how do I make it
recogonize lower case letters??Any advise?
Thanks in advance
Andz Tag: copying files Tag: 194982
passing variables
Hi ppl
i am in need for some help on a usermanager script i am writing.
My problems is this, when using this code snippet i found on Technet i want
to substitue the C:\finance and FianaceShare with a variable.
these are declared before this code and can pop a message box fine so i know
they are working fine. When i drop the quotes and just put in a variable i
get an error expected ]
any help would be much appreciated
Daz
Const FILE_SHARE = 0
Const MAXIMUM_CONNECTIONS = 25
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objNewShare = objWMIService.Get("Win32_Share")
errReturn = objNewShare.Create _
("C:\Finance", "FinanceShare", FILE_SHARE, _
MAXIMUM_CONNECTIONS, "Public share for the Finance group.")
Wscript.Echo errReturn Tag: copying files Tag: 194981
Add money to your Paypal account with OPRAH xsDat
Read this message until the end, and you will find out how the money flows in easy !!!!.
Follow the steps and it WILL work. Trust me !!!!!.
It's NOT illegal and it is NOT a scam !!!!!.
PROVEN ON OPRAH! Reported in the Wall Street Journal!!!!
The only thing you need is : - E-MAIL ACCOUNT
- PREMIER (FREE) or BUSINESS PAYPAL ACCOUNT
- $6 on this account (The only investment)
- 30 minutes of your time
There is no limit on how much money you can recieve, and you haven't got anything to lose with this Business program. I will explain how it works !!!!!.
Follow these 4 easy steps and it WILL work !!!!!.
STEP 1 : SIGN UP FOR A FREE PAYPAL ACCOUNT !!!!!.
Paypal is a free and safe way to pay and receive money on the Internet.
Creating a account is as easy as creating a MSN account.
Copy and paste the next line in your Internet browser and sign up.
HTTP://WWW.PAYPAL.COM
Be sure to sign up for a FREE Premier or Business account and not for a Personal account.
You cannot receive CREDITCARD payments with a Personal account and we can't have that. Do we !!!!!.
STEP 2 : SENT $6 TO YOUR PAYPAL ACCOUNT
This is your only investment to receive the money with ease.
With your Paypal account, send $1 to each e-mailadres listed below.
!!!!! IMPORTANT !!!!! Be sure to use this SUBJECT : *PLEASE PUT ME ON YOUR EMAIL LIST* when you send the money.
1) martine@pilote.net
2) dexxatol@netcourrier.com
3) armygirl8568@hotmail.com
4) comjii@starband.net
5) sinnek@bellsouth.net
6) nsi@nelasat.com
STEP 3 : PUT YOUR E-MAIL ADDRESS ON THE BOTTOM OF THE LIST
After you have send $1 to each e-mail address, put your e-mail address on the 6th place.
Remove e-mail address number 1, and move each e-mail address 1 step up the ladder.
!!!!! IMPORTANT !!!!! BE SURE THAT THE E-MAIL ADDRESS YOU USE IS THE SAME AS YOU USED TO SIGN UP AT PAYPAL.
Remember that this is LEGAL. You are creating a service : an e-mail servicelist.
STEP 4 : UPLOAD OR COPY THIS MESSAGE TO NEWSGROUPS, FORUMS ETC AND EMAIL IT TO ALL YOUR FRIENDS!
There are 32,000 newsgroups. Upload or copy this message to at least 200 newsgroups or forums etc, but ........ remember that the more your upload the more people will see your message and the MORE MONEY WILL FLOW IN.
How to upload to newsgroups and forums? :
After you have followed step 1,2,3 and 4, save this message (and copy so you can use it again).
Use your Internet browser and Outlook Express or another newsreader and try to find FORUMS, NEWSGROUPS,
BULLETIN BOARDS, DISCUSSION GROUPS, CHAT SITES and ONLINE COMMUNITIES. Use GOOGLE or use a NEWSERVER.
Use every option to post this message. Download PostXpert to send 1 message to more NEWSGROUPS at the
same time.
!!!!! REMEMBER !!!!! The more you post this message the more MONEY WILL FLOW IN.
Why does this Business program work so well !!!!!.
Lets asume that from the 200 (or more) messages that you have posted, only 5 people respond, you will have your
$6 back that you have invested. Those 5 people will each send at least 200 messages with your e-mailadres on
number 4. That's 6 x 6 x $1 = $36. The next 25 people will also send 200 messages with your adres on number 3. That's 36 x 6 x $1 = $216. The next 216 people also send 200 messages with your name on number 2. That's 216 x 6
x $1 = $1296!. Those 1296 people again also send 200 messages with your name on number 1. That will give us a total of 1296 x 6 x $1 = $7,776.
Now the last tier! 7776 x 6 x $1 = $46,656!!!!!!
This is only a EXAMPLE with 6 reactions. You WILL get MORE responses than that.
Remember that most newsservers will leave the posted messages on there servers for about 2 weeks. If you will post your message again, it WILL again start from the beginning. So you can repeat this over and over again.
Everyday MILLIONS of people are ONLINE and reading these messages, JUST LIKE YOU RIGHT NOW.
I also was sceptical in the beginning and have read a lot of these messages. I also thought that it was bullshit.
Until I thought : What the hell!, only $6. What's $6 and a couple of minutes of my time to solve my money problems.
!!!!! REMEMBER !!!!! Follow every step, and IT WILL WORK, TRUST ME. !!!!!
!!!!! BEST WISHES AND GOOD LUCK !!!!!
w)O>+;)<9UVS;F>qaGL<Uq#v`V6(F]- rM;$g+!4IIQ*827?H4 Tag: copying files Tag: 194979
Re: Using Run to access Start
Csaba Gabor wrote:
> This is not clear to me. %cmdcmdline% as such, as far as I know,
> exists only within cmd.exe. However, as far as I am aware, whenever
> any program is started off, it has an associated "command line" that
> caused it to be executed. Within a VB Project you can obtain it
> directly with Command$ and from c++ evidently with GetCommandLine().
I don't believe that cmd.exe will be involved at all for some ways that
you script could be started. i.e
wscript scriptname.vbs <some arguments> from start/run will just start
wscript.exe directly.
It sounds to me that you need to re-think what you are trying to achieve
here or perhaps explain a little more of your reasoning for wanting to
get at %cmdcmdline% - perhaps then someone can come up with an
alternative approach.
--
VS Tag: copying files Tag: 194976
Creating new reg key, but default value is messed up.
I have a script changes some snmp community settings on our servers.
It deletes the existing key, creates a new one and populates it with
our new traps. Only problem is that when it creates the new key, the
default vaule looks wrong. It gets assigned a value instead of the (no
value).. its not causing any issues, but was wondering if anyone found
better syntax than what I am using to create a new key.. Here is the
line and below it I posted the whole script
'recreate the key
WshShell.RegWrite
"HKLM\system\currentcontrolset\services\snmp\parameters\trapconfiguration\delltrap\",
1, "REG_SZ"
Whole script
On Error Resume Next
'set the traps.
value1 = "blah"
value2 = "blah2"
value3 = "blah3"
value4 = "blah4"
'create the scripting object
Set WshShell = WScript.CreateObject("WScript.Shell")
'delete the existing key
WshShell.RegDelete
"HKLM\system\currentcontrolset\services\snmp\parameters\trapconfiguration\delltrap\"
'recreate the key
WshShell.RegWrite
"HKLM\system\currentcontrolset\services\snmp\parameters\trapconfiguration\delltrap\",
1, "REG_SZ"
WshShell.RegWrite
"HKLM\system\currentcontrolset\services\snmp\parameters\trapconfiguration\delltrap\1",value1
WshShell.RegWrite
"HKLM\system\currentcontrolset\services\snmp\parameters\trapconfiguration\delltrap\2",Value2
WshShell.RegWrite
"HKLM\system\currentcontrolset\services\snmp\parameters\trapconfiguration\delltrap\3",Value3
WshShell.RegWrite
"HKLM\system\currentcontrolset\services\snmp\parameters\trapconfiguration\delltrap\4",Value4 Tag: copying files Tag: 194970
Setting IE's Temporary Internet File Folder - WMI or GPO
I'm stuck, I need to know if it is possilbe to set the folder location
with wmi/VBscript. If not is it possible use an add-in for GPO to do
it?
Please keep in mind I already have the code for retrieveing the
information with WMI, but I need the code for changing the folder
location.
Thanks,
Greg Tag: copying files Tag: 194968
how to query user's desktop
How would I query user's desktop folders using WMI? I've tried using
%username% in the profile path but that doesn't seem to work. I know
WMI uses '%' as a wildcard. Help please. Tag: copying files Tag: 194956
objEmail.To combine variable and string
I'm trying to combine a variable email address and a string email address.
Microsoft VBScript compilation error '800a0401'
Expected end of statement
objEmail.To = Recordset1("email_mypic");"mail@tcp.com"
---------------------------------------^Notice anything wrong?objEmail.To =
Recordset1("email_mypic");"mail@tcp.com" Tag: copying files Tag: 194954
File permissions
Hi! :)
Until now I've used SetAcl.exe for setting permissions but I would like to
learn to do it by myself now.
(SetAcl.exe works fine for most things but a lot of the time you have to map
a drive for it to work over the network though it sais it should work with
UNC paths and then there's the problem with having to bring the exe file
whereever you go...)
Any tips on where I can find information om how to set permissions with only
vbs and what's built into the os'es?
I think I searched on it a while back but only found bad sites without
examples.
I guess what I'm looking for is really a few good examples.
Thanks a million! :)
/Sofia Tag: copying files Tag: 194950
VBS Logon Script Help
I have the following VBS script that runs at logon and removes a shared
printer on a server. This work great but if the user was to logon again the
script would error saying printer does not exist. Can anyone help with
script so that if it gets this error it would not display error ocde on
screen and just finish? New to VBS.....
VBS Script
' RemovePrinterConnection.vbs - Windows logon script
' VBScript to - Network Printer
' ------------------------------------------------------'
Option Explicit
Dim objNetwork, strUNCPrinter
strUNCPrinter = "\\servername\HPLaserJ1022NW"
Set objNetwork = CreateObject("WScript.Network")
' Section which removes the network printer
objNetwork.RemovePrinterConnection strUNCPrinter
'WScript.Echo "Check Printers folder NO: " & strUNCPrinter
Wscript.Quit
Error Code Display on screen if you have already run this cript and its
tries again
Line 1
Char 1
Error: This Network connection does not exist
Code: 800708CA
Source: wshNetwork.RemoveNetworkDrive
Thanks Tag: copying files Tag: 194944
Script help please (unlock locked out accounts) NEWBIE
G'day all
I've got two questions if you will
The below script (that I hacked together )will unlock a users account
that has entered the wrong password too many times but I have a
problem with the user interface. I want our helpdesk people to be
able to use the loginID instead of the users full name.
How can I get the fullname from a user input of the loginID
so that I can then use that in the GETOBJECT section?
How can I find out all the options for objUser ?
I suppose this is some sort of comand reference
Thanks regards
Mark
Aus
*****SCRIPT START**************************
'Get the user name
UserLOGID = InputBox("Enter the Login ID of the User you wish to unlock")
'if Cancel selected - exit
If (UserLOGID = "") Then Wscript.Quit
'Get the Organizational Unit
OrgInput=InputBox( _
"Select the Organizational unit by number" & vbCRLF & vbCRLF _
& " 1 - SITE1" & vbCRLF _
& " 2 - SITE2" & VbCrLf _
& " 3 - SITE3" & vbCRLF _
& " 4 - SITE4" & vbCRLF _
& " 5 - SITE5" & vbCRLF _
& " 6 - SITE6" & vbCRLF _
& " 7 - SITE7" & vbCRLF & VbCrLf )
'if Cancel selected - exit
If (OrgInput = "") Then Wscript.Quit
If (OrgInput = "1") Then OrgUnit="SITE1"
If (OrgInput = "2") Then OrgUnit="SITE2"
If (OrgInput = "3") Then OrgUnit="SITE3"
If (OrgInput = "4") Then OrgUnit="SITE4"
If (OrgInput = "5") Then OrgUnit="SITE5"
If (OrgInput = "6") Then OrgUnit="SITE6"
If (OrgInput = "7") Then OrgUnit="SITE7"
MsgBox ("You're unlocking "& UserLOGID & VbCrLf _
& "from Organizational Unit "& OrgUnit)
'error check input
If (INSTR("1234567",Action)=0) OR (Len(Action)>1) then
y = msgbox("Unacceptable input passed -- '" & OrgUnit & "'", _
vbOKOnly + vbCritical, "That was SOME bad input!")
Wscript.Quit
End If
Set objUser = GetObject _
("LDAP://cn="& UserLOGID &",ou="& OrgUnit
&",ou=People,dc=internal,dc=business,dc=big,dc=com,dc=au")
objUser.IsAccountLocked = False
objUser.SetInfo
MsgBox ("Account has been unlocked" & vbOKOnly)
Wscript.Quit
*****SCRIPT END************************** Tag: copying files Tag: 194943
Batch file or VB script for more automated USMT?
I have created individual batch files for scanstate and loadstate where I
edit them for each user. I have to manually change the user name, manually
change the file name of the batch files I create for each user, and manually
name the share name and location where each user's data is saved.
Is there a way to make this much easier, such as a batch file or VB script
that simply prompts you for the user name and the site (user name entered at
the prompt then being used to automatically choose the username for scan
state and load for loadstate, as well as create/name a directory based on
user name to store the USMT data. Site name entered would determine from
what location scanstate and load state executables would run and where the
data files would be saved so that it always saves the data to the local site
of the user rather than across a WAN).
Basically I want an interface that is very simple and prompts:
Are you collecting data from the old PC or loading data to the new PC? (A or
B)
Which site? (4 choices)
What is the user name?
The person running the tool should only need to run the tool, enter the
answers to those 3 prompts.
They would run it from the old PC to collect the data, wait for the data to
be saved to the network share, then run it at the new computer to load the
data.
It would great if it at least show a message saying loadstate or scanstate
is in progress and then show when completed sucessfully.
I doubt I could be the first person to think of this, so maybe something
like this has already beeen created or else can someone help with this? Tag: copying files Tag: 194940
RegExp Help
Hi,
Ok, this may be stupid on my part, but I hate asking for help since it
is an affirmation that I am not as smart as I think I am.. Anyhow...I
wrote a ADSI script that automates the creation of distribution groups.
Sometimes users provide illegal or unsupported characters for the name
of the group so I need to escape the characters in order to Put the
distinguished name of the object. Most likely the name that is
provided will only have one of these characters. I just don't
understand the matches object well enough to use firstindex, etc...Here
is some sample code I have. Thanks for any help provided.
strData = "my+test?hel>lo"
Set regEx = New RegExp
regEx.Pattern = "\+|\?|\>"
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(strData)
For Each match In matches
StringToReplace = regEx.Replace(strData, "\" & match.value)
Next
Set regEx = Nothing
WScript.Echo StringToReplace
Output: my\>test\>hel\>lo
Intended Output: my\+test\?hel\>lo Tag: copying files Tag: 194938
How to read Registry STRING_EXPAND_SZ WITHOUT EXPANDING?
How can I read a STRING_EXPAND_SZ value from the Registry and get the
%SystemRoot% (or any other possible substitute string for that matter)
verbatim, without being substituted?
Thanks in advance. Tag: copying files Tag: 194931
VBScript and MSOffice
Is it possible to harvest all the fieldnames and 1st line of data from all
xls and mdb's using vbscript? The reason is to verify a company computer does
not have SSN's or bank account or checking account files, or cc numbers on
it. A policy might be in place but to actually audit hundreds of machines
would take months, and by then I would need to audit again! To find all the
files is easy, but to make things simple I would want to gleam all the data
into a csv file with the machine name, filename and path in case you found
one you would know where it came from. Is this out of the range of reasonable
for vbscript? Tag: copying files Tag: 194919
SQL query: Error as if column is not there?
Hello,
I'm having a strange problem. I get an error "Item cannot be found in
the collection corresponding to the request name or orginal," even
though WEISGSUPPORT is contained within the BladeAlias column:
Set objRecordSet = objConnection.Execute("Select BladeOwner,
CageSerialNum, SlotNum FROM SMBlades WHERE BladeAlias =
'WEISGSUPPORT';")
Do While Not objRecordset.EOF
strResults = strResults & objRecordSet("BladeAlias") & vbnewline
objRecordset.MoveNext
Loop
I get the error at the first line in the do...loop.
Why is this happening? It's driving me crazy!
Thanks for the help,
Matt Tag: copying files Tag: 194914
Copy folder off network share, overright if existing, and run a specified program
I have been fighting with this all morning. I need to copy a folder off
of a network share, overright the folder if it exists on the local
machine and run a specified program with switches as a administrator.
Can you please help with this.
Network Share path \\server\software\folder Tag: copying files Tag: 194906
Creating a Link Checker
So my boss has been killing me about creating a link checker, what I
need to know is there a sample script somewhere to get me started on
creating a checker? Basically we have a ton of links and want to check
if they are valid as in not hardcoded, not sure I want to check if the
link is actually working cause that might not be an easy thing to pull
off. Reason I am doing vbs is cause we cannot install anything on our
server and running something client side is not dependable. With a vbs
file I can just schedule it and produce a report and email it to myself
or anyone else who needed to see if there were broken links. Any leads
to good example scripts? Tag: copying files Tag: 194904
Bulk Delete groups from AD
I am trying to bulk delete groups from AD using VBScript. I have a list
of the distinguished names of the groups in an Excel spreadsheet.
My problem is that the groups span accross several domains in my AD
forest and i am unable to find a script which will delete an object
purely by the distinguished name. All the scripts i have found have to
at least bind to the domain container first.
Can anyone help me with this? Tag: copying files Tag: 194902
I'm tring a VBscripting to send a fax, can someone please help me?
Hey.. I'm running some vba code to change a certain sheet accordingly
to some information. This sheet then should be faxed to a certain
client, the problem is that Every sheet differs to their respective
client and ther's 500 clients. How will I be able to send every sheet
to it's respectible customer, with the click of one button? I can
already print every sheet with the specific information, but how will I
fax it without having to enter the details of 500 people, can I use a
vbscript file and how do I do that? Tag: copying files Tag: 194898
Web expression
Hi,
I would like to know is there a generic rule that I can follow to determine
if the string is a valid URL?
eg. prefix is http, www...etc. Tag: copying files Tag: 194896
Error message
I have created a kixform login script (I've also posted this question on the
kixforms board). The form contains a hyperlink to the H: drive and a
hyperlink to the S: drive. The first time I click either I get an error
message simillar to:
Windows cannot find 'ldist,:1588:4064,h:\' Make sure you typed the name
correctly, and then try again. To search for a file, click on the Start
button, and then click search.
After I click on OK and then reclick on the link, everything works fine.
Has anyone experienced anything simillar to this?
Thanks,
Jeremy Tag: copying files Tag: 194894
Can anyone recommend a script to copy 2 different files from a network share
to 2 different locations on a local hard disk?