Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Vbs/batch problem  (Read 3068 times)

0 Members and 1 Guest are viewing this topic.

Poraft

  • Guest
Vbs/batch problem
« on: June 15, 2010, 01:52:16 PM »
Before I start, I want to say hi since I'm new here.

I want to make a file that makes a new batch file in the "start-up" folder with vbs, here is what I got so far.

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("C:\Documents and Settings\Menu Start\Programma's\%username%\Opstarten\VIRUS.bat")
a.WriteLine ("shutdown -s -t 60")
a.close   

It's just to make a fake virus to mess some friends but, I can't find or make a correct path, if i make the "%username%" my own computer username it perfectly works. And creates a batch file in the start up folder.

But how can I make the correct path that depends on the currently logged in account?


Dusty



    Egghead

  • I could if she would, but she won't so I don't.
  • Thanked: 75
  • Experience: Beginner
  • OS: Windows XP
Re: Vbs/batch problem
« Reply #1 on: June 15, 2010, 02:50:08 PM »
Quote
It's just to make a fake virus to mess some friends

Your attempted use of a C'Hope forum for this purpose contravenes the rules which you should have read here

Quote
If you’re looking for help with getting revenge on someone else and/or hacking into a program or service look elsewhere.  This also includes supposedly "harmless" pranks.  This is not what Computer Hope was designed for.
One good deed is worth more than a year of good intentions.