modify xcopy to do several checks

February 18, 2010 at 10:25:02
Specs: Windows XP
I have a very basic xcopy batch file set up with a separate run code .VBS type, to make the program go to the background instead of having the cmd screen showing what it's doing. This is the code I have.
BATCH File ->
C:\WINDOWS\System32\xcopy.exe "C:\Documents and Settings\admin\My Documents\*" E:\work\program\ /S /C /I /Q
.VBS File ->
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "E:\work\cp.bat" & Chr(34), 0
Set WshShell = Nothing

-- The Problem --
.VBS File - I need for the .VBS script to check what drive it's in and run from that drive, or list multiple drives that it should check for without it giving any error, because when I set the wrong drive and try to run it, it just gives me an error. For example I set the drive D:\ and when I plug in the usb it's actually in E:\... It would also be nice if there's a way to make the file execute itself automatically once the flash drive is plugged in into the PC.

Batch File -
1. Just like the .VBS file, It would be nice for the script to be able to check which directory its in, and copy to that directory, in other words ( E:\work\program\ /S /C /I /Q ) instead of me having to set E:\, have it check which drives it's in and copy to (The Drive):\work\program.
2. I'm not sure if this could be done, but I want the batch file also to search for each user on the machine and copy the files in my documents or any other directory I set. For example "C:\Documents and Settings\Admin\My Documents\*" when this is set it copies everything in my documents from the Admin user. I want it to copy the My Documents from all the users in the machine "C:\Documents and Settings\&&\My Documents\*" The && theoretically stand for any user on the machine.
3. What else do I add to the code so that my screen doesn't flash black when the code is getting executed?

Thanks


See More: modify xcopy to do several checks

Report •


#1
February 18, 2010 at 15:51:55
You can always write a script that contains this code :

xcopy "C:\Documents and Settings\username\My Documents\*" \work\program /S /C /I /Q

Omitting the driveletter (as in \work\program) results in the CURRENT drive to be used. So, the condition would be that you just have to place the script ANYWHERE on that drive. It may be in \something\else ... it does not matter, since he reads the command, and copies to \work\program, on that same drive.


Report •

#2
February 19, 2010 at 12:05:05
And this loop to query usernames:

@echo off
setlocal enabledelayedexpansion

for /F "delims=\ tokens=1-3" %%a in ('dir "C:\Documents and Settings" /b /ad') do echo %%a


Report •

#3
February 19, 2010 at 16:36:21
yeah, that was my thought: just do a dir of "\docments and settings" to get all users' names, but you might need to filter it some to not get the hidden dir.s (which aren't users) as well as filter the "all users":
set /a xx=0
for /f "tokens=*" %%a in ('dir /b "\documents and settings" ^| find /v "All Users"') do
set xx+=1
set user!xx!=%%a
)
If you need to explicitly address the drive your script is in:
for /f %%a in ('cd') do set drv=%%~da
this script will list all drives and their "types", which you can apply a filter to find the usb drive(s):

@echo off>alldrv & setlocal enabledelayedexpansion
set /a xx=11
echo 4,4l > edl.in
echo e >> edl.in
fsutil fsinfo drives >> edl.in
edlin edl.in < edl.in > drives
for /f "skip=2 tokens=*" %%a in (drives) do (
set aa=%%a
goto :test
)

:test
set nn=!aa:~%xx%,2!
if "%nn%" equ "" goto :listout
set /a xx+=5
:echo.%nn%
fsutil fsinfo drivetype %nn% >> alldrv
goto :test

:listout
for /f "tokens=*" %%a in (alldrv) do echo %%a

This would be a good one to make as a standalone batch that can be called by other batches.
The reason for all the EDLIN malarky is due to Microsoft deciding to put zeros (instead of spaces) between the drives in the output of fsutil fsinfo drives. The ONLY reason i can think of that they did that is simply pure meanness. The only "native" way i could get rid of the zeros was to use EDLIN. (DEBUG could also be used, but it requires more steps).Notepad will read it, but you can't pipe into notepad.
to keep from the "blackscreen" flash, i think you just need to shell with vbHide (which is 0):
shell ("cmd mybat.bat",vbHide)


Report •

Related Solutions

#4
February 19, 2010 at 17:39:31
so how would I include this in the script?
I mean how would i include it here, C:\WINDOWS\System32\xcopy.exe "C:\Documents and Settings\admin\My Documents\*" \work\program\ /S /C /I /Q

@echo off
setlocal enabledelayedexpansion

for /F "delims=\ tokens=1-3" %%a in ('dir "C:\Documents and Settings" /b /ad') do echo %%a

set /a xx=0
for /f "tokens=*" %%a in ('dir /b "\documents and settings" ^| find /v "All Users"') do
set xx+=1
set user!xx!=%%a
)
BTW do I include both in the file or??... I'm new at this, that's why I want to start with something easy, so bear with me please. :)
Thanks for the responses.
tvc i tested your first idea and it works great... now I don't have to specify the stupid drive (tnx).


Report •

#5
February 19, 2010 at 18:53:23
@slifer: my apologies, i made several dumb mistakes.
Tvc had a better take on what's going on than i did.
I thought the script(s) were running on the main system, but when i went back an re-read your post, i got the other idea: they run from the usb stick. Also, i got vbasic mixed up with vbscript (i do that a lot), so the "shell" with "vbHide" is a visbasic thing and not wscript/vbscript. Let me try to compensate. First though, question where are you copying all the users files to? the usb stick? or c:\work?
for this example, just substitute for "c:\dir1" where you want them to actually go. "target" is the directory that you "set", either prompted or cmdline. (it could also be read from a file).
I will use cmdline in example with prompt when not provided:

set target=%1
if "%target%=="" (
set /p target=Enter target directory:
if "%target% =="" goto :eof
)
:: foll. is all on one line!
for /f "tokens=*" %%a in ('dir /b "c:\documents and settings" ^| find /v "All Users"') do xcopy "c:\documents and settings\%%a\target\*.* c:\dir1

If it turns out you DO want the all users stuff, just take out the ^| find /v "All Users" part from the line. This is just my version, it is supposed to be self-complete.
Sorry about the confusion. please post any further developments and help will be forthcoming.


Report •

#6
February 19, 2010 at 19:53:33
Well, I plugged the line in and it doesn't seem to be filtering the "Public" user out... or if it were on xp "All Users". Otherwise it works and it's copying the files from the other users.

This is how the script looks like when I put it in
for /f "tokens=*" %%a in ('dir /b "c:\users" ^| find /v "Public"') do xcopy "c:\users\%%a\Documents\*" \work\program\ /S /C /I /Q

so not to get confused, for xp it would be,

for /f "tokens=*" %%a in ('dir /b "c:\Documents and Settings" ^| find /v "All Users"') do xcopy "c:\Documents and Settings\%%a\Documents\*" \work\program\ /S /C /I /Q

I tested this on vista (that's why I included the first part of the script I pasted), however I don't think that matters... if it works on vista it should work on xp :)


Report •

#7
February 20, 2010 at 05:59:37
Don't you need the /I parameter with FIND ?

If not used, it will only filter "Public", not "public", not "PUBLIC", and not whatever other mixed case would occur.

Note that the list of users on XP may be : All Users, Default User, Localservice, Networkservice and <my account>


Report •

#8
February 20, 2010 at 12:57:52
yeah, i should prob'ly have put the /i. you never know.
winXP seems to have a multitude of "ghost users", on mine it has:
All Users
user
All Users.WINDOWS
in addition to Administrator and regular users. And i still don't know where to put the autoexe.nt. It never executes in any of the folders mentioned so for now i have to set the path manually each time i go into cmd. I'll figger it out one'a'these days.

Report •

#9
February 20, 2010 at 13:28:57
autoexe.nt ?

Report •

#10
February 20, 2010 at 14:07:28
Typo: meant autoexeC.nt (the replacement, or supposed to be replacement for autoexec.bat)

Report •

#11
February 20, 2010 at 14:36:48
"It would also be nice if there's a way to make the file execute itself automatically once the flash drive is plugged in into the PC."

@O.P:
there was mention of an auto-run file "autorun.inf" that will kick in when the usb is plugged in, but i don't know if the issue ever got resolved.
you might try putting this into autorun.inf in the root of the usb:
[autorun]
open=\autorun.bat

(or whatever you call your batchfile to be run)
I don't have a usb drive to try it on, so i can't test it. The original poster had windows 7 and it wouldn't run on his system, but supposedly it runs on XP.


Report •

#12
February 20, 2010 at 16:58:51
Here's what I found to work so far and what I still can't do --------

Working -> for /f "tokens=*" %%a in ('dir /b "C:\Documents and Settings" ^| find /V /I "All Users"') do xcopy "C:\Documents and Settings\%%a\My Documents\*" \work\program\ /S /C /I /Q

copy's the files from the dir and omits the "All Users"
When I run the .VBS it executes the .batch into the background so it's not seen (great)!

Problems left ->
1. What else do I add to the code so that my screen doesn't flash black when the code is getting executed? (in xp the screen still flashes black)
2. The file still doesn't execute when the flash is plugged in.

--------------------
2. I tested what you recommended on XP, however I had no luck. Here's what I put in the autorun.inf
[autorun]
OPEN=ttp.vbs
ACTION=Start my application
since just Open=\work\cp.bat wouldn't do anything at all.
This way it gave me a dialog box and I just had to hit enter, however when I set it to run the ttp.VBS file that makes the cp.bat execute into the background it told me "win32 does not recognize that format" (or something close to that wow)
Then when I put in
[autorun]
OPEN=ttp.vbs
ACTION=Start my application
It gave me a dialog box again, i hit enter, and this time it gave me exactly this "Access Denied" | "F:\"

BTW -> this does not work on vista at all...

-------------------
still have no idea how to fix problem 1....
here's my ttp.VBS script

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "\work\cp.bat" & Chr(34), 0
Set WshShell = Nothing

Thanks for the help so far, it's been great!


Report •

#13
February 20, 2010 at 21:41:19
the blackout-thing i cannot work with, since i don't have the equipment. The other, autorun, probly can't help with either. (sounds optimistic, huh?) only sugg. is if vbs needs to be run under WSCRIPT or CSCRIPT instead of standalone.
Although it runs under cmd.exe, it might need to be run as:
open=wcript.exe ttp.vbs

other than that, i'm afraid i've run the limit of my helps. hope you can get everything smoothed out. good luck.


Report •

#14
February 21, 2010 at 04:13:35
Why do you use VBS script ... BAT/CMD is also a script, and this may solve the screen output issue ?

What concerns the USB plug-and-run ... yeah, that is a mess on Windows. What if you do the other way, let Windows regularly check whether or not a USB stick is in, and if it spots it, run a script on there ?!


Report •

#15
February 21, 2010 at 11:49:05
Well, thank you nbrane you have been very helpful :)

tvc I set up the VBS script because when i run it it gives an execution command to the cp.bat, and it sends it to the Background process instead of having a black cmd window showing what the program is doing.
I want it from the usb because i don't want to have to set up every computer to do that...


Report •

#16
February 21, 2010 at 13:45:20
one last suggestion as suggested by Tvc's question:
what about START /MIN cp.bat, like:
open=START /MIN \work\cp.bat
or maybe "run=" or "start="
(i don't know the INF options, these are just something else to try)

Report •

#17
February 22, 2010 at 05:00:05
Yes, but I think you then will have a DOS box ... minimized. It's still there ... The threadstarter wants to run it in ghost mode, so it cannot be seen (cannot be interrupted ?!).

That part, DOS is pretty persistent ... can't really work without the black box. But, you CAN hide all relevant info (redirect to nul), so if the goal is to HIDE info, it can be done.

But, I think the issue is that ppl think that DOS is bad, because it is not very cool or trendy. Can't do much against that, dumb people will always be dumb. But, you can change the black color to a nice(r) color. ;)

I'm just joking.


Report •

#18
February 22, 2010 at 22:23:01
hahaha :)
thanks for the help :) I really appreciate it.

- nbrane - (or anyone who is familiar with VB)
Since you do VB, i have a quick question. "I hope it's quick"...

The CODE ->
Module Module1

Sub Main()
Dim shell
shell = CreateObject("wscript.shell")
shell.run(Chr(34) & ("F:\work\cp.bat") & Chr(34), 0)
shell = Nothing
End Sub

End Module
------
This is under console application. After the compilation I take the .exe file and put it in my flash. I tried it when I specify the drive and the location, so F:\work\cp.bat, works great. So I want to make it so that I don't have to specify a drive F:\, because it might not be that drive when I plug in the USB. So maybe have it search for the drive it's in.... (this is before I compile it... since after compilation I can't make changes)
One more thing, what line of code should I add so that when I run the .exe instead of the small black window popping up, it's minimized for that ( 1 second ) it's on the screen.

THANK YOU


Report •

#19
February 22, 2010 at 23:06:05
here is sample output from "DRIVES.BAT" (resp. #3, 2nd part):
A: - Removable Drive
C: - Fixed Drive
E: - CD-ROM Drive
G: - Remote/Network Drive
H: - Remote/Network Drive
K: - Remote/Network Drive

what i don't know and can't find out since i don't have a usb drive is what it would show up as in the above.
"temporary drive", "usb drive", "flash drive", "removeable drive" etc.
what your script needs to do is locate the usb drive in this "page" of output and determine the letter. "FIND" with the appropriate string will give that to you, i just don't know what that string is. (Maybe i'll invest in a stick just for fun, but i keep hoping i'll find one in the dumpsters). That should solve at least problem #1 (determination of driveletter).
I am very NOT good at vbscript, but working on it, very limited knowledge in general, but i want to experiment with the "blackscreen" thing, as I'm curious now. I know it can't be a big deal, it's just my own limits of knowledge.
good luck - post a sample of what the usb drive looks like on ouput of fsutils batch.


Report •

#20
February 23, 2010 at 02:23:27
What are you saying Nbrane, you are considering into the investment of a USB stick ?

Report •

#21
February 23, 2010 at 07:45:33
My usb drive is usually F:\ since the C:\ drive is regular for the system D:\ is recovery and E:\ is cd/dvd however it's not the same for every computer. since some computers have cd drive and dvd drive, so when you plug in the usb it comes out as G:\ since drive F is taken by another usb drive/cd or dvd... But yea that's what I want it to do. Search from all the drives and locate it's self (a code for that) so I don't have to set the specific drive before compilation. I should probably post this in VB section, but I wanted to see if you could help first :)

Report •

#22
February 23, 2010 at 08:11:02
if the script is running from the usb, why can't it just do this:
set usb=%cd:~0,2%
hopefully you get some better help from the vb guys!


@tvc: nah, not right now - funds are very limited


Report •

#23
February 23, 2010 at 09:41:37
Sub Main()
set usb=%cd:~0,2%
Dim shell
shell = CreateObject("wscript.shell")
shell.run(Chr(34) & ("%cd:\work\cp.bat") & Chr(34), 0)
shell = Nothing

End Sub

End Module

that's what I put in, however I get an error that "set/let" is no longer available and Name "usb" is not declared.


Report •

#24
February 23, 2010 at 10:52:06
no, that (%cd:~0,2%) only works in batch script, not vbscript.
i'm confused as to whether you're using visual basic or vbscript
if it's vbasic, left(curdir(),2) will give you the drive i think.

Report •

#25
February 23, 2010 at 11:00:56
I'm using Visual Basic (2005) version.
I'm just not sure if this could be done though. Because before I compile it it requires a valid directory :( ....

Report •

#26
February 23, 2010 at 14:56:14
ok, that solves a mystery!
i compiled and ran this:
Sub main()
Dim wsh
Set wsh = CreateObject("wscript.shell")
dr = Left(CurDir(), 2) + "\test.bat"
'''wsh.run(Chr(34) & ("F:\work\cp.bat") & Chr(34), 0)
''''wsh.run Chr(34) & (dr) & Chr(34), 0
wsh.run (dr), 0
''''wsh = Nothing
End Sub

your syntax worked, but it was unfamiliar to me and i was
having some problems so i commed them out.
also removed "wsh=nothing" cause my vb didn't like it.
I ran the compiled .exe on my a drive and it worked from there. (it referenced a:\test.bat instead of c:\test.bat)
this one worked just as well:
Sub main()
dr = Left(CurDir(), 2) + "\test.bat"
Shell (dr), 0
End Sub


Report •

#27
February 23, 2010 at 21:45:20
Cool. It works :)
Thanks for the help, that was a tough one for me :)
I just hope it works on xp as well as it does in vista... going to try tomorrow and let you know ;)

Report •

#28
February 24, 2010 at 15:47:54
This is gonna sound weird... I tried recompiling today because it wasn't working, and it gave me erors on both... on The first one it gave me a "dr" error, that is was unknow...
and for the second part of the script that you listed it gave me Sub end <- error. I must have deleted something the first time it allowed me to compile, since this time it didn't want to :(

Report •

#29
February 24, 2010 at 17:47:46
maybe it's something to do with your system or your vb version (forgot to mention mine is old: vb3.2). I have vb6, i might see what happens using that (i usually just use the old one). I ported vb3.2 over to my XP system, recompiled the program on that system and ran it on that system and everything worked as it should. VB put the following as first line of my program (probably when i compiled):
attribute VB_Name="Module1"
but other than that, the program is identical to what i posted.
update: tried compiling with vb6 and it compiled and ran on both machines.
my XP is sp2.

Report •

#30
February 24, 2010 at 19:42:13
interesting... nbrane can you make the compilation and upload it somewhere... i'll download it and see if I can edit it with my VB and see what the difference is. So you know my scipt, but I'll post it again, including the dir of the file and everything...

--------------
Sub Main()
Dim shell
shell = CreateObject("wscript.shell")
shell.run(Chr(34) & ("F:\work\cp.bat") & Chr(34), 0)
shell = Nothing
End Sub
-----------
of course instead of F:\ i want it to find the dir... otherwise the work\cp.bat is correct :)


Report •

#31
February 24, 2010 at 22:12:16
might not be necessary, as the script you posted won't compile. this:
shell.run(Chr(34) & ("F:\work\cp.bat") & Chr(34), 0)

looks like this to vbasic (any version!)

shell.run("("F:\work\cp.bat")", 0)

there's way too many dlbquots and parenths flying around!
here is what i'm using (i'll swap in your batchfile name)

Sub main()
dr = Left(CurDir(), 2) + "\work\cp.bat"
Shell (dr), 0
End Sub

get rid of everything else, i say. run "clean an mean".
try it and let me know, if it fails, i'll arrange to get the guts of mine over to you to examine.


Report •

#32
February 25, 2010 at 08:03:57
Well, it doesn't let me compile. It says ( dr ) is not "defined". So it aborts the compilation and tells me to fix the problem...

Report •

#33
February 25, 2010 at 08:43:21
not sure if you can use this, but it could be made directly into an executable if you wanted by piping into debug:
http://pastebin.com/ZFULDVVx

if you want to go that route, let me know and i'll pmail you the pipe input (so you won't have to dither with this: removing the memory-addresses and ascii stuff)


Report •

#34
February 26, 2010 at 15:01:20
can you upload the .exe itself somewhere ? because I don't know how to insert that compiled code...

Report •

#35
February 26, 2010 at 17:02:23
the pastebin has been converted into a batchfile which will construct the .exe file. Just go to:
http://pastebin.com/ZRKDxyNu
and hit the download button, change the name to somethng.bat then run the batchfile. the executable will be called "forum.exe" and all it does is run \work\cp.bat.
(i created a fake \work\cp.bat that just appended some text to itself and it worked ok using the executable generated from the batchfile, just to make sure it would work.)
I tried mediafire upload and it let me upload but it never gave me the location where to find it! I tried to go to "my files" and it just gave me that stupid rolling "barber pole" thingey and never gave me my file. If the batch-exe fails, let me know and i will arrange another delivery method (probably my own web page).
ps: here's an alternative syntax for the line:
xx=shell(dr,0)
(but i doubt if that will make a diff.)
you said the compiled .exe ran ok on one machine, (vista?) i'm still curious as to why it compiled and ran on one and not the other, but we may never know, and i guess you just want to move on with it! good luck, keep us posted.

Report •

#36
February 26, 2010 at 23:03:28
it says it can't find a dll file when I try to run the .exe :)
btw this method you used, is pretty cool... impressive!

for the VB project, It compiled once to an .exe but not the second time, so I assume that I forgot to put in an important part of the code the first time, like the dr ".." line.

I'm going to try to make a shortcut to the ttp.vbs and see if the shortcut will be able to run the .vbs file, and if the autorun could run the shortcut :)

thanks for the continues help...


Report •

#37
February 27, 2010 at 04:26:47
> @tvc: nah, not right now - funds are very limited
>

LOL


Report •

#38
March 3, 2010 at 08:01:38
Well, the shortcut runs the .vbs file without a problem, however the autorun doesn't run the shortcut since it's not an .exe ;)

Report •

#39
March 3, 2010 at 12:10:02
Shortcuts should be able to run any runnable file, like the ones listed here, no ?

PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH


Report •

#40
March 3, 2010 at 18:15:28
yeah, but what he said is that the autorun won't run the shortcut, although the shortcut will run the .vbs
(I'm still confused if vbs is a script or a visbasic file - the extension says its a vbscript file...)
But the autorun apparently won't run a .lnk (shortcut) file.
vbSCRIPT can also get the "current" drive and run the batch invisible:
set wsh=creatobject("wscript.shell")
set fso=createobject("scripting.filesystemobject")
dr=getabsolutepathname(".\work")
'dr=left(dr,2)
'this is just for info...
msgbox dr
' i just guessed at this, (adding the zero) but it seemed to work
wsh.run(dr&"\cp.bat"),0

for this to work, you will probably have to include wscript.exe on the usb drive, (but my wscript is only abt 118K, not too awful big).
autorun.inf:
[autorun]
open=wscript.exe /nologo test.wsh


Report •

#41
March 4, 2010 at 08:03:32
That's the part i don't know how to do :) otherwise the script i have runs well... It runs the .bat file into the background.
The .vbs script I have; I just created in notepad and saved it as .vbs (I got it form a website, since I wasn't sure how to make the script myself). this is the vbSCRIPT.

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "\work\cp.bat" & Chr(34), 0
Set WshShell = Nothing

The question is how to create the wscript.exe to function properly and execute the .vbs file (since it's a usb...)

BTW "open=wscript.exe /nologo test.wsh" what is the test.wsh part do, or in this case what does it stand for?

Thanks


Report •

#42
March 4, 2010 at 12:40:05
it doesn't do anything since it is a mistake! LL, sorry, i got mixed up when typing, it was supposed to be "test.vbs", which is the stand-in for your ttp.vbs.
"The question is how to create the wscript.exe to function properly and execute the .vbs file (since it's a usb...)"
does the "open=wscript.exe" not work?
since it's an .exe file, it should run from autorun.inf.
but now that you mention it, you will probably need the support-files on the usb drive also. wshom.ocx, and maybe wshext.dll. Most windows systems probably have these (on c:), but you might want the extra insurance of having them on the usb drive. undoubtedly there is some registry stuff involved also, prob'ly just have to go on hopeful for that.
If you want another stab at the vis.basic, you can download the dll file vb40032.dll from here:
http://www.dll-files.com/dllindex/d...
or google on vb40032 download. That's the only dll file required.

Report •

#43
March 5, 2010 at 01:28:03
> yeah, but what he said is that the autorun won't run
> the shortcut, although the shortcut will run the .vbs
>

Seems like a simple problem to me ... either specify the real target in autorun (instead of the shortcut), or let the shortcut point to a BAT/CMD, which runs an EXE ... ?!


Report •

#44
March 5, 2010 at 05:37:36
i think it's mainly a problem of executing the copy-files batch script inside a "wrapper" that will shield it from the "black command-box window". kind of a capsule to keep the command-box from showing up.
If i had a usb laying around, i would try various approaches, but since i don't, i'll have to burn a CD or just guess.
For now, I'll wait to see what developes...

Report •

#45
March 5, 2010 at 14:00:23
The autorun won't run the .vbs :( I don't know why :(
nbrate I will probably try the idea next week since I don't have time this weekend :(

I will keep you posted thought.


Report •

#46
March 5, 2010 at 23:51:25
What is with this surge in interest with auto-running programs/scripts when you insert a thumb drive? MS prevents it. Then, in Win7, they went back and prevented it harder.

nbrane: does the "open=wscript.exe" not work?
Autorun.inf only looks on the drive its on, so you can't reference wscript.exe, as it lives in %systemroot%\system32


Report •

#47
March 6, 2010 at 06:54:47
yeah, that was the basis of my suggestion that he might have to include wscript.exe (and wshom.ocx etc) on the usb drive, so it would be sure to be accessible.
In the same spirit, to use the vis-basic version, the vb40032.dll would have to be included on the usb drive to support the compile executable (of vb32 compile. vb5,6 would require their own .dlls)

Report •

#48
March 25, 2010 at 16:38:08
Sorry for the long wait... I actually still haven't had a chance to try this out since I don't have an XP machine at home. I will try it on my friends computer over the weekend, that is if he lets me :)

Report •

#49
April 7, 2010 at 22:42:46
Hey, putting the wscript.exe and wshom.ocx in the usb, helped. Now i just run the .vbs with the wscript... Thanks! :) I know it's been some time, but I did not have an XP to test it on!

Report •

#50
April 8, 2010 at 11:35:02
SLiFeR: putting the wscript.exe and wshom.ocx in the usb, helped
That's really the wrong way to go about it. Especially since autorun.inf has a ShellExecute option.

Also, you could have avoided what was apparently months of frustration if you had Googled the syntax of autorun.inf.


Report •

#51
April 8, 2010 at 14:00:43
Nice, you are right, that works too.

Report •

Ask Question